fixed a couple of bugs in folder manipulation, in particular:
[squirrelmail.git] / src / load_prefs.php
index 97785f6f66a5b023fbb48cb2cdc128f8a65bc520..69c74dec21fe1371999d6b6f6172d2c2c852a4f8 100644 (file)
@@ -1,11 +1,52 @@
 <?
+   include("../config/config.php");
    include("../functions/prefs.php");
 
-   $chosen_theme = getPref($username, "chosen_theme");
+   checkForPrefs($data_dir, $username);
 
-   if (isset($chosen_theme)) {
+   $chosen_theme = getPref($data_dir, $username, "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: ");
+         echo $theme[0]["PATH"];
+         echo _(" was not found.");
+         echo "<BR>";
+         echo _("Exiting abnormally");
+         exit;
+      }
+   }
+
+
+   /** Load the user's trash folder preferences **/
+   $move_to_trash = getPref($data_dir, $username, "move_to_trash");
+   if ($move_to_trash == "")
+      $move_to_trash = $default_move_to_trash;
+
+   $wrap_at = getPref($data_dir, $username, "wrap_at");
+   if ($wrap_at == "")
+      $wrap_at = 86;
+
+   $editor_size = getPref($data_dir, $username, "editor_size");
+   if ($editor_size == "")
+      $editor_size = 76;
+
+   $use_signature = getPref($data_dir, $username, "use_signature");
+   if ($use_signature == "")
+      $use_signature = false;
+
+   $left_refresh = getPref($data_dir, $username, "left_refresh");
+   if ($left_refresh == "")
+      $left_refresh = false;
+   
+   /** Load up the Signature file **/
+   if ($use_signature == true) {
+      $signature = getSig($data_dir, $username);
+   } else {
    }
-?>
\ No newline at end of file
+?>
+