Moved the force_username_lowercase stuff to redirect.php
[squirrelmail.git] / src / right_main.php
index 1827afa1a256b6c419a84fd88eb742bab7c8862d..6c1ca9b06cd8268b7aa472e343a5a96f80018ba1 100644 (file)
     **
     **/
 
+   if (!isset($i18n_php))
+      include("../functions/i18n.php");
 
    session_start();
 
    if(!isset($logged_in)) {
+      set_up_language($squirrelmail_language, true);
       echo _("You must login first.");
       exit;
    }
    if(!isset($username) || !isset($key)) {
+      set_up_language($squirrelmail_language, true);
       echo _("You need a valid user and password to access this page!");
       exit;
    }
    /** If it was a successful login, lets load their preferences **/
    include("../src/load_prefs.php");
 
+   if (isset($newsort) && $newsort != $sort) {
+      setPref($data_dir, $username, "sort", $newsort);
+   }
+
    // If the page has been loaded without a specific mailbox,
    //   send them to the inbox
    if (!isset($mailbox)) {
       $mailbox = "INBOX";
-      $sort = $newsort = 0;
       $startMessage = 1;
    }
 
 
    do_hook("right_main_bottom");
    // close the connection
+   sqimap_mailbox_close($imapConnection);
    sqimap_logout ($imapConnection);
 ?>
 </FONT>