Added support for RFC1522 (MIME coding of headers).
[squirrelmail.git] / src / right_main.php
index 3071e422e3105839f113bf4c2f66a75c0dbd52b8..ddd01e4d2c87672f0a575b5fbe9d5d3e93759449 100644 (file)
@@ -8,16 +8,19 @@
     **/
 
    if(!isset($logged_in)) {
-      echo "You must <a href=\"login.php\">login</a> first.";
+      echo _("You must ");
+      echo "<a href=\"login.php\">";
+      echo _("login");
+      echo "</a>";
+      echo _(" 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;
    }
 ?>
 <HTML>
-<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#0000EE" VLINK="#0000EE" ALINK="#0000EE">
 <FONT FACE="Arial,Helvetica">
 <?
    include("../config/config.php");
@@ -26,7 +29,7 @@
    include("../functions/date.php");
    include("../functions/page_header.php");
    include("../functions/array.php");
-   include("../functions/mailbox.php");
+   include("../functions/mime.php");
    include("../functions/mailbox_display.php");
    include("../functions/display_messages.php");
 
    //
    /////////////////////////////////////////////////////////////////////////////////
 
-
    // open a connection on the imap port (143)
-   $imapConnection = loginToImapServer($username, $key, $imapServerAddress);
+   $imapConnection = sqimap_login($username, $key, $imapServerAddress, 0);
+
+   /** If it was a successful login, lets load their preferences **/
+   include("../src/load_prefs.php");
+   echo "<BODY TEXT=\"$color[8]\" BGCOLOR=\"$color[4]\" LINK=\"$color[7]\" VLINK=\"$color[7]\" ALINK=\"$color[7]\">\n";
+   echo "<FONT FACE=\"Arial,Helvetica\">";
 
    // 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 "</BODY></HTML>";
       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);
+   sqimap_mailbox_select($imapConnection, $mailbox);
+   $numMessages = sqimap_get_num_messages ($imapConnection, $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");
-   fclose($imapConnection);
+   sqimap_logout ($imapConnection);
 ?>
 </FONT>
 </BODY>