* Fixed the MOTD
[squirrelmail.git] / src / right_main.php
index e4b569cc438cc7349f3cf79daf08fb3b49e9cc10..b8bf19ab492d77119bff1f4b1becccb8f68445b6 100644 (file)
     **  $Id$
     **/
 
-   if (!isset($i18n_php))
-      include('../functions/i18n.php');
+   include('../src/validate.php');
+   include('../functions/imap.php');
+   include('../functions/date.php');
+   include('../functions/array.php');
+   include('../functions/mime.php');
+   include('../functions/mailbox_display.php');
+   include('../functions/display_messages.php');
 
-   session_start();
-
-   if(!isset($logged_in) || !isset($username) || !isset($key)) {
-      include ('../themes/default_theme.php');
-      include ('../functions/display_messages.php');
-      printf('<html><BODY TEXT="%s" BGCOLOR="%s" LINK="%s" VLINK="%s" ALINK="%s">',
-              $color[8], $color[4], $color[7], $color[7], $color[7]);
-      plain_error_message(_("You need a valid user and password to access this page!")
-                          . '<br><a href="../src/login.php">'
-                          . _("Click here to log back in.") . "</a>.", $color);
-      echo '</body></html>';
-      exit;
-   }
-
-   if (!isset($strings_php))
-      include('../functions/strings.php');
-   if (!isset($config_php))
-      include('../config/config.php');
-   if (!isset($imap_php))
-      include('../functions/imap.php');
-   if (!isset($date_php))
-      include('../functions/date.php');
-   if (!isset($page_header_php))
-      include('../functions/page_header.php');
-   if (!isset($array_php))
-      include('../functions/array.php');
-   if (!isset($mime_php))
-      include('../functions/mime.php');
-   if (!isset($mailbox_display_php))
-      include('../functions/mailbox_display.php');
-   if (!isset($display_messages_php))
-      include('../functions/display_messages.php');
-?>
-<?php
    /////////////////////////////////////////////////////////////////////////////////
    //
    // incoming variables from URL:
@@ -66,9 +37,6 @@
    // open a connection on the imap port (143)
    $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
 
-   /** 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);
    }
@@ -81,7 +49,8 @@
    }
 
    // compensate for the UW vulnerability
-   if ($imap_server_type == 'uw' && strstr($mailbox, '../')) {
+   if ($imap_server_type == 'uw' && (strstr($mailbox, '../') !== false ||
+                                     substr($mailbox, 0, 1) == '/')) {
       $mailbox = 'INBOX';
    }
 
       session_register('numMessages');
    }
 
-   do_hook('ight_main_bottom');
+   do_hook('right_main_bottom');
    sqimap_logout ($imapConnection);
 ?>
 </FONT>