X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=src%2Fright_main.php;h=d706044314632ada5592f2c9a13fce4e757043f5;hb=11307a4c707a22ef7dc2530b0e33c2afa5329e58;hp=5c86e1445317d5008ccaf120a0a676206eba413a;hpb=4c2d69acdad62c5b56c437debc24c7e75e3003cf;p=squirrelmail.git
diff --git a/src/right_main.php b/src/right_main.php
index 5c86e144..d7060443 100644
--- a/src/right_main.php
+++ b/src/right_main.php
@@ -17,7 +17,6 @@
}
?>
-
include("../config/config.php");
@@ -45,29 +44,20 @@
//
/////////////////////////////////////////////////////////////////////////////////
-
// open a connection on the imap port (143)
- $imapConnection = fsockopen($imapServerAddress, 143, &$errorNumber, &$errorString);
- if (!$imapConnection) {
- echo "Error connecting to IMAP Server.
";
- echo "$errorNumber : $errorString
";
- exit;
- }
- $serverInfo = fgets($imapConnection, 256);
+ $imapConnection = loginToImapServer($username, $key, $imapServerAddress);
- // login
- fputs($imapConnection, "1 login $username $key\n");
- $read = fgets($imapConnection, 1024);
- if (strpos($read, "NO")) {
- error_username_password_incorrect();
- exit;
- }
+ /** If it was a successful login, lets load their preferences **/
+ include("../src/load_prefs.php");
+ echo "\n";
+ echo "";
// 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);
+ displayPageHeader($color, "None");
+ general_info($motd, $org_logo, $version, $org_name, $color);
+ echo "";
exit;
}
@@ -75,10 +65,10 @@
selectMailbox($imapConnection, $mailbox, $numMessages);
// Display the header at the top of the page
- displayPageHeader($mailbox);
+ displayPageHeader($color, $mailbox);
// Get the list of messages for this mailbox
- showMessagesForMailbox($imapConnection, $mailbox, $numMessages, $startMessage, $sort);
+ showMessagesForMailbox($imapConnection, $mailbox, $numMessages, $startMessage, $sort, $color);
// close the connection
fputs($imapConnection, "1 logout\n");