updated changelog
[squirrelmail.git] / src / load_prefs.php
index 01452b1ad68a933ef4521d01e060df36559871da..3691d079c062912dce0f26515a343e492bcb2587 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");
                 break;
          }
    }
-   if (!$in_ary) {
-               $chosen_theme = "";
-   }
 
-   if ((isset($chosen_theme)) && (file_exists($chosen_theme))) {
-      require("$chosen_theme");
+   if ($in_ary && (file_exists($chosen_theme))) {
+      $loaded=@include($chosen_theme);
    } else {
       if (file_exists($theme[0]["PATH"])) {
          require($theme[0]["PATH"]);
@@ -59,7 +58,9 @@
           $color[11]  = "#770000"; // (dark red)       Special Folders color
       }
    }
-
+    if (!isset($loaded)) 
+      echo _("Unable to load chosen theme file:") . ' "' .
+       $chosen_theme . '"';
     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');
+   
+   $show_html_default = getPref($data_dir, $username, 'show_html_default');
 
    do_hook("loading_prefs");