* Fixed weird addressbook problem over SMTP
[squirrelmail.git] / src / load_prefs.php
index d37d1082d240b5787151884daf0b0d9efc72d845..6778427a433f3442690135a16381c56e6fae4149 100644 (file)
@@ -8,6 +8,7 @@
     **  Loads preferences from the $username.pref file used by almost
     **  every other script in the source directory and alswhere.
     **
+    **  $Id$
     **/
 
    if (!isset($config_php))
@@ -18,6 +19,8 @@
       include("../functions/plugin.php");
       
    $load_prefs_php = true;
+   if (!isset($username))
+       $username = '';
    checkForPrefs($data_dir, $username);
 
    $chosen_theme = getPref($data_dir, $username, "chosen_theme");
@@ -33,7 +36,7 @@
    }
 
    if ((isset($chosen_theme)) && (file_exists($chosen_theme))) {
-      require("$chosen_theme");
+      $loaded=@include("$chosen_theme");
    } else {
       if (file_exists($theme[0]["PATH"])) {
          require($theme[0]["PATH"]);
@@ -58,8 +61,8 @@
           $color[11]  = "#770000"; // (dark red)       Special Folders color
       }
    }
-
-       session_register("theme_css");
+    if (!isset($loaded)) echo "loading configured theme $chosen_theme failed";
+    if (!isset($download_php)) session_register("theme_css");
 
    $use_javascript_addr_book = getPref($data_dir, $username, "use_javascript_addr_book");
    if ($use_javascript_addr_book == "")
    if ($use_signature == "")
       $use_signature = false;
 
+   $prefix_sig = getPref($data_dir, $username, "prefix_sig");
+   if ($prefix_sig == "")
+      $prefix_sig = false;
+
    $left_refresh = getPref($data_dir, $username, "left_refresh");
    if ($left_refresh == "")
       $left_refresh = false;
       $index_order[$i] = $order;
       $order = getPref($data_dir, $username, "order".($i+1));
    }
-   if (!$index_order) {
+   if (!isset($index_order)) {
       $index_order[1] = 1;
       $index_order[2] = 2;
       $index_order[3] = 3;
    $location_of_buttons = getPref($data_dir, $username, 'location_of_buttons');
    if ($location_of_buttons == '')
        $location_of_buttons = 'between';
+       
+   $collapse_folders = getPref($data_dir, $username, 'collapse_folders');
 
    do_hook("loading_prefs");