Pref file now isn't created if the login failed
authorlkehresman <lkehresman@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Thu, 6 Jan 2000 20:54:06 +0000 (20:54 +0000)
committerlkehresman <lkehresman@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Thu, 6 Jan 2000 20:54:06 +0000 (20:54 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@117 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/imap.php
src/left_main.php
src/load_prefs.php
src/right_main.php
src/webmail.php

index eaffda33f7842fbb2731d23e950342d4208c2027..2780f4b00263121bf0ab207ac435ec94d0950b49 100644 (file)
          echo "SERVER SAYS: $read<BR>";
       }
 
+      /** If the login attempt was UNsuccessful, lets see why **/
       if (substr($read, 0, 7) != "a001 OK") {
          if (!$hide) {
             if (substr($read, 0, 8) == "a001 BAD") {
                exit;
             }
             else if (substr($read, 0, 7) == "a001 NO") {
-               echo "<BR>";
+               echo "<HTML><BODY BGCOLOR=FFFFFF><BR>";
                echo "<TABLE COLS=1 WIDTH=70% NOBORDER BGCOLOR=FFFFFF ALIGN=CENTER>";
                echo "   <TR>";
                echo "      <TD BGCOLOR=\"DCDCDC\">";
index dea9fd580f7a38c01fddf191a196404784b8be5d..db84533b8c3f7f6c2532e892884ce2ba8ae830cb 100644 (file)
@@ -20,8 +20,6 @@
    include("../functions/imap.php");
    include("../functions/mailbox.php");
 
-   include("../src/load_prefs.php");
-
    function formatMailboxName($imapConnection, $mailbox, $delimeter, $color) {
       require ("../config/config.php");
 
       return $line;
    }
 
-   echo "<BODY BGCOLOR=\"$color[3]\" TEXT=\"$color[6]\" LINK=\"$color[6]\" VLINK=\"$color[6]\" ALINK=\"$color[6]\">";
-   echo "<FONT FACE=\"Arial,Helvetica\">";
    // open a connection on the imap port (143)
    $imapConnection = loginToImapServer($username, $key, $imapServerAddress, 10); // the 10 is to hide the output
 
+   /** If it was a successful login, lets load their preferences **/
+   include("../src/load_prefs.php");
+   checkForPrefs($data_dir, $username);
+   echo "<BODY BGCOLOR=\"$color[3]\" TEXT=\"$color[6]\" LINK=\"$color[6]\" VLINK=\"$color[6]\" ALINK=\"$color[6]\">";
+   echo "<FONT FACE=\"Arial,Helvetica\">";
+
    getFolderList($imapConnection, $boxes);
 
    echo "<FONT FACE=\"Arial,Helvetica\" SIZE=4><B><CENTER>";
index 973ae4abda4f7b73adfdf5f5fabbd2bc54f43ce2..5b5803551e6e90f6749445d219f4bb86dab996c8 100644 (file)
@@ -4,9 +4,15 @@
 
    $chosen_theme = getPref($data_dir, $username, "chosen_theme");
 
-   if (isset($chosen_theme)) {
+   if ((isset($chosen_theme)) && (file_exists($chosen_theme))) {
       require("$chosen_theme");
    } else {
-      require($theme[0]["PATH"]);
+      if (file_exists($theme[0]["PATH"])) {
+         require($theme[0]["PATH"]);
+      } else {
+         echo "Theme: " . $theme[0]["PATH"] . " was not found.<BR>";
+         echo "Exiting abnormally";
+         exit;
+      }
    }
 ?>
\ No newline at end of file
index 988267b3f08cb65aab4df0348fa0e1cb7205c643..288ce90d70a546d24c672e94c623191c34e91edb 100644 (file)
    include("../functions/mailbox_display.php");
    include("../functions/display_messages.php");
 
-   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\">";
    /////////////////////////////////////////////////////////////////////////////////
    //
    // incoming variables from URL:
    // open a connection on the imap port (143)
    $imapConnection = loginToImapServer($username, $key, $imapServerAddress);
 
+   /** If it was a successful login, lets load their preferences **/
+   include("../src/load_prefs.php");
+   checkForPrefs($data_dir, $username);
+   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)) {
index ed6df33c8759723eacfa941c77f8ec1a16eca802..05601d9eb01f5f1b38d769163a67149c404bda3d 100644 (file)
@@ -36,8 +36,6 @@
     This was done to create a pure HTML way of refreshing the folder list since
     we would like to use as little Javascript as possible.
 **/
-   checkForPrefs($data_dir, $username);
-
    if ($right_frame == "right_main.php") {
       $urlMailbox = urlencode($mailbox);
       echo "<FRAME SRC=\"left_main.php\" NAME=\"left\">";