login first."; exit; } if(!isset($username) || !isset($key)) { echo "You need a valid user and password to access this page!"; exit; } ?> "; echo "$errorNumber : $errorString
"; exit; } $serverInfo = fgets($imapConnection, 256); // login fputs($imapConnection, "1 login $username $key\n"); $read = fgets($imapConnection, 1024); if (strpos($read, "NO")) { error_username_password_incorrect(); exit; } // If the page has been loaded without a specific mailbox, // just show a page of general info. if (!isset($mailbox)) { displayPageHeader("None"); general_info($motd, $org_logo, $version, $org_name); exit; } // switch to the mailbox, and get the number of messages in it. selectMailbox($imapConnection, $mailbox, $numMessages); // Display the header at the top of the page displayPageHeader($mailbox); // Get the list of messages for this mailbox showMessagesForMailbox($imapConnection, $mailbox, $numMessages, $startMessage, $sort); // close the connection fclose($imapConnection); ?>