X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=src%2Fright_main.php;h=619aa938b4c304b83fdd8928eb69f690b5ca1e92;hb=46812a3a1b10154d4444caaab7ce2a76108b7b90;hp=ffe3117b2de2ca22bf10529eb927212e51cdc1b3;hpb=aa32c5e4a04adb6e5bc3db6a25ef736ffc267d3a;p=squirrelmail.git diff --git a/src/right_main.php b/src/right_main.php index ffe3117b..619aa938 100644 --- a/src/right_main.php +++ b/src/right_main.php @@ -1,35 +1,47 @@ -login first."; + echo _("You must login first."); exit; } if(!isset($username) || !isset($key)) { - echo "You need a valid user and password to access this page!"; + echo _("You need a valid user and password to access this page!"); exit; } -?> - - - - +"; - exit; + $mailbox = "INBOX"; + $sort = $newsort = 0; + $startMessage = 1; + +// 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); + sqimap_mailbox_select($imapConnection, $mailbox); + displayPageHeader($color, $mailbox); - // Display the header at the top of the page - displayPageHeader($mailbox); + if (isset($newsort)) { + $sort = $newsort; + session_register("sort"); + } - // Get the list of messages for this mailbox - showMessagesForMailbox($imapConnection, $mailbox, $numMessages, $startMessage, $sort); + // Check to see if we can use cache or not. Currently the only time when you wont use it is + // when a link on the left hand frame is used. Also check to make sure we actually have the + // array in the registered session data. :) + if ($use_mailbox_cache && session_is_registered("msgs")) { + showMessagesForMailbox($imapConnection, $mailbox, $numMessages, $startMessage, $sort, $color, $show_num, $use_mailbox_cache); + } else { + if (session_is_registered("msgs")) + unset($msgs); + if (session_is_registered("msort")) + unset($msort); + if (session_is_registered("numMessages")) + unset($numMessages); + + $numMessages = sqimap_get_num_messages ($imapConnection, $mailbox); + + showMessagesForMailbox($imapConnection, $mailbox, $numMessages, $startMessage, $sort, $color, $show_num, $use_mailbox_cache); + + if (session_is_registered("msgs") && isset($msgs)) + session_register("msgs"); + if (session_is_registered("msort") && isset($msort)) + session_register("msort"); + session_register("numMessages"); + } // close the connection - fputs($imapConnection, "1 logout\n"); - fclose($imapConnection); + sqimap_logout ($imapConnection); ?>