login first."; exit; } if(!isset($username) || !isset($key)) { echo "You need a valid user and password to access this page!"; exit; } ?> \n"; echo ""; ///////////////////////////////////////////////////////////////////////////////// // // incoming variables from URL: // $sort Direction to sort by date // values: 0 - descending order // values: 1 - ascending order // $startMessage Message to start at // $mailbox Full Mailbox name // // incoming from cookie: // $username duh // $key pass // ///////////////////////////////////////////////////////////////////////////////// // open a connection on the imap port (143) $imapConnection = loginToImapServer($username, $key, $imapServerAddress); // If the page has been loaded without a specific mailbox, // just show a page of general info. if (!isset($mailbox)) { displayPageHeader($color, "None"); general_info($motd, $org_logo, $version, $org_name, $color); echo ""; 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($color, $mailbox); // Get the list of messages for this mailbox showMessagesForMailbox($imapConnection, $mailbox, $numMessages, $startMessage, $sort); // close the connection fputs($imapConnection, "1 logout\n"); fclose($imapConnection); ?>