* Fixed weird addressbook problem over SMTP
[squirrelmail.git] / src / load_prefs.php
index 01452b1ad68a933ef4521d01e060df36559871da..6778427a433f3442690135a16381c56e6fae4149 100644 (file)
@@ -19,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");
@@ -34,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"]);
@@ -59,7 +61,7 @@
           $color[11]  = "#770000"; // (dark red)       Special Folders color
       }
    }
-
+    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_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");