X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=src%2Fright_main.php;h=d0f380798e1f66a635ab08eb4ed5f856d1003011;hb=e5baaf7433627b4fcbf8b73a78f163d1f82f1497;hp=1def94edfdb5ffb4280ea0ed82db1001b205d77a;hpb=d92b6f319c3ca67ff701db9da869b42c298ef9a4;p=squirrelmail.git diff --git a/src/right_main.php b/src/right_main.php index 1def94ed..d0f38079 100644 --- a/src/right_main.php +++ b/src/right_main.php @@ -1,36 +1,24 @@ -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: @@ -47,29 +35,83 @@ ///////////////////////////////////////////////////////////////////////////////// // open a connection on the imap port (143) - $imapConnection = loginToImapServer($username, $key, $imapServerAddress); + $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0); + + if (isset($newsort) && $newsort != $sort) { + setPref($data_dir, $username, 'sort', $newsort); + } // If the page has been loaded without a specific mailbox, - // just show a page of general info. + // send them to the inbox if (!isset($mailbox)) { - displayPageHeader($color, "None"); - general_info($motd, $org_logo, $version, $org_name, $color); - echo ""; - exit; + $mailbox = 'INBOX'; + $startMessage = 1; } - // switch to the mailbox, and get the number of messages in it. - selectMailbox($imapConnection, $mailbox, $numMessages); + // compensate for the UW vulnerability + if ($imap_server_type == 'uw' && (strstr($mailbox, '../') !== false || + substr($mailbox, 0, 1) == '/')) { + $mailbox = 'INBOX'; + } - // Display the header at the top of the page + sqimap_mailbox_select($imapConnection, $mailbox); displayPageHeader($color, $mailbox); - // Get the list of messages for this mailbox - showMessagesForMailbox($imapConnection, $mailbox, $numMessages, $startMessage, $sort); + do_hook('right_main_after_header'); + + if ($just_logged_in == true) { + $just_logged_in = false; + + if (strlen(trim($motd)) > 0) { +?>
+ +
+ + +
+
+