testing multiple file commits for CVS messages
[squirrelmail.git] / src / load_prefs.php
CommitLineData
59177427 1<?php
37df47f5 2 if (!isset($config_php))
3 include("../config/config.php");
d30d79f2 4 if (!isset($prefs_php))
5 include("../functions/prefs.php");
37df47f5 6
7 $load_prefs_php = true;
b4da6659 8 checkForPrefs($data_dir, $username);
9
d0747e26 10 $chosen_theme = getPref($data_dir, $username, "chosen_theme");
d3cdb279 11
f3d17401 12 if ((isset($chosen_theme)) && (file_exists($chosen_theme))) {
d3cdb279 13 require("$chosen_theme");
14 } else {
f3d17401 15 if (file_exists($theme[0]["PATH"])) {
16 require($theme[0]["PATH"]);
17 } else {
67c62ef9 18 echo _("Theme: ");
f94ff7ce 19 echo $theme[0]["PATH"];
20 echo _(" was not found.");
21 echo "<BR>";
67c62ef9 22 echo _("Exiting abnormally");
f3d17401 23 exit;
24 }
d3cdb279 25 }
11307a4c 26
3806fa52 27 $use_javascript_addr_book = getPref($data_dir, $username, "use_javascript_addr_book");
28 if ($use_javascript_addr_book == "")
29 $use_javascript_addr_book = $default_use_javascript_addr_book;
30
31
1573e796 32 /** Load the user's sent folder preferences **/
33 $move_to_sent = getPref($data_dir, $username, "move_to_sent");
34 if ($move_to_sent == "")
35 $move_to_sent = $default_move_to_sent;
36
37 /** Load the user's trash folder preferences **/
38 $move_to_trash = getPref($data_dir, $username, "move_to_trash");
39 if ($move_to_trash == "")
40 $move_to_trash = $default_move_to_trash;
41
42
1e0628fb 43 $folder_prefix = getPref($data_dir, $username, "folder_prefix");
44 if ($folder_prefix == "")
45 $folder_prefix = $default_folder_prefix;
46
47 /** Load special folders **/
48 $new_trash_folder = getPref($data_dir, $username, "trash_folder");
49 if (($new_trash_folder == "") && ($move_to_trash == true))
50 $trash_folder = $folder_prefix . $trash_folder;
51 else
52 $trash_folder = $new_trash_folder;
53
54 /** Load special folders **/
55 $new_sent_folder = getPref($data_dir, $username, "sent_folder");
56 if (($new_sent_folder == "") && ($move_to_sent == true))
57 $sent_folder = $folder_prefix . $sent_folder;
58 else
59 $sent_folder = $new_sent_folder;
11307a4c 60
9c83f905 61 $show_num = getPref($data_dir, $username, "show_num");
62 if ($show_num == "")
63 $show_num = 25;
64
11307a4c 65 $wrap_at = getPref($data_dir, $username, "wrap_at");
66 if ($wrap_at == "")
67 $wrap_at = 86;
68
2848c630 69 $left_size = getPref($data_dir, $username, "left_size");
70 if ($left_size == "") {
71 if (isset($default_left_size))
72 $left_size = $default_left_size;
73 else
74 $left_size = 200;
75 }
76
11307a4c 77 $editor_size = getPref($data_dir, $username, "editor_size");
78 if ($editor_size == "")
79 $editor_size = 76;
f804972b 80
81 $use_signature = getPref($data_dir, $username, "use_signature");
82 if ($use_signature == "")
83 $use_signature = false;
84
469eb37b 85 $left_refresh = getPref($data_dir, $username, "left_refresh");
86 if ($left_refresh == "")
87 $left_refresh = false;
88
f804972b 89 /** Load up the Signature file **/
90 if ($use_signature == true) {
91 $signature = getSig($data_dir, $username);
92 } else {
f804972b 93 }
636e611c 94
95 /** Load up the Language preference **/
96 $user_language = getPref($data_dir, $username, "language");
97 if ($user_language == "") {
98 if (isset($default_charset))
99 $user_language = $default_charset;
100 else
101 $user_language = en;
102 }
103
11307a4c 104?>