59177427 |
1 | <?php |
ef870322 |
2 | /** |
3 | ** load_prefs.php |
4 | ** |
5 | ** Copyright (c) 1999-2000 The SquirrelMail development team |
6 | ** Licensed under the GNU GPL. For full terms see the file COPYING. |
7 | ** |
8 | ** Loads preferences from the $username.pref file used by almost |
9 | ** every other script in the source directory and alswhere. |
10 | ** |
11 | **/ |
12 | |
37df47f5 |
13 | if (!isset($config_php)) |
14 | include("../config/config.php"); |
d30d79f2 |
15 | if (!isset($prefs_php)) |
16 | include("../functions/prefs.php"); |
37df47f5 |
17 | |
18 | $load_prefs_php = true; |
b4da6659 |
19 | checkForPrefs($data_dir, $username); |
20 | |
d0747e26 |
21 | $chosen_theme = getPref($data_dir, $username, "chosen_theme"); |
d3cdb279 |
22 | |
f3d17401 |
23 | if ((isset($chosen_theme)) && (file_exists($chosen_theme))) { |
d3cdb279 |
24 | require("$chosen_theme"); |
25 | } else { |
f3d17401 |
26 | if (file_exists($theme[0]["PATH"])) { |
27 | require($theme[0]["PATH"]); |
28 | } else { |
67c62ef9 |
29 | echo _("Theme: "); |
f94ff7ce |
30 | echo $theme[0]["PATH"]; |
31 | echo _(" was not found."); |
32 | echo "<BR>"; |
67c62ef9 |
33 | echo _("Exiting abnormally"); |
f3d17401 |
34 | exit; |
35 | } |
d3cdb279 |
36 | } |
11307a4c |
37 | |
2de8df87 |
38 | session_register("theme_css"); |
39 | |
3806fa52 |
40 | $use_javascript_addr_book = getPref($data_dir, $username, "use_javascript_addr_book"); |
41 | if ($use_javascript_addr_book == "") |
42 | $use_javascript_addr_book = $default_use_javascript_addr_book; |
43 | |
44 | |
1573e796 |
45 | /** Load the user's sent folder preferences **/ |
46 | $move_to_sent = getPref($data_dir, $username, "move_to_sent"); |
47 | if ($move_to_sent == "") |
48 | $move_to_sent = $default_move_to_sent; |
49 | |
50 | /** Load the user's trash folder preferences **/ |
51 | $move_to_trash = getPref($data_dir, $username, "move_to_trash"); |
52 | if ($move_to_trash == "") |
53 | $move_to_trash = $default_move_to_trash; |
54 | |
55 | |
24fc5dd2 |
56 | $unseen_type = getPref($data_dir, $username, "unseen_type"); |
57 | if ($default_unseen_type == "") |
58 | $default_unseen_type = 1; |
59 | if ($unseen_type == "") |
60 | $unseen_type = $default_unseen_type; |
61 | |
62 | $unseen_notify = getPref($data_dir, $username, "unseen_notify"); |
63 | if ($default_unseen_notify == "") |
64 | $default_unseen_notify = 2; |
65 | if ($unseen_notify == "") |
66 | $unseen_notify = $default_unseen_notify; |
67 | |
68 | |
1e0628fb |
69 | $folder_prefix = getPref($data_dir, $username, "folder_prefix"); |
70 | if ($folder_prefix == "") |
71 | $folder_prefix = $default_folder_prefix; |
72 | |
73 | /** Load special folders **/ |
74 | $new_trash_folder = getPref($data_dir, $username, "trash_folder"); |
75 | if (($new_trash_folder == "") && ($move_to_trash == true)) |
76 | $trash_folder = $folder_prefix . $trash_folder; |
77 | else |
78 | $trash_folder = $new_trash_folder; |
79 | |
80 | /** Load special folders **/ |
81 | $new_sent_folder = getPref($data_dir, $username, "sent_folder"); |
82 | if (($new_sent_folder == "") && ($move_to_sent == true)) |
83 | $sent_folder = $folder_prefix . $sent_folder; |
84 | else |
85 | $sent_folder = $new_sent_folder; |
11307a4c |
86 | |
9c83f905 |
87 | $show_num = getPref($data_dir, $username, "show_num"); |
88 | if ($show_num == "") |
89 | $show_num = 25; |
90 | |
11307a4c |
91 | $wrap_at = getPref($data_dir, $username, "wrap_at"); |
92 | if ($wrap_at == "") |
93 | $wrap_at = 86; |
94 | |
2848c630 |
95 | $left_size = getPref($data_dir, $username, "left_size"); |
96 | if ($left_size == "") { |
97 | if (isset($default_left_size)) |
98 | $left_size = $default_left_size; |
99 | else |
100 | $left_size = 200; |
101 | } |
102 | |
11307a4c |
103 | $editor_size = getPref($data_dir, $username, "editor_size"); |
104 | if ($editor_size == "") |
105 | $editor_size = 76; |
f804972b |
106 | |
107 | $use_signature = getPref($data_dir, $username, "use_signature"); |
108 | if ($use_signature == "") |
109 | $use_signature = false; |
110 | |
469eb37b |
111 | $left_refresh = getPref($data_dir, $username, "left_refresh"); |
112 | if ($left_refresh == "") |
113 | $left_refresh = false; |
114 | |
f804972b |
115 | /** Load up the Signature file **/ |
116 | if ($use_signature == true) { |
c36ed9cf |
117 | $signature_abs = $signature = getSig($data_dir, $username); |
f804972b |
118 | } else { |
c36ed9cf |
119 | $signature_abs = getSig($data_dir, $username); |
f804972b |
120 | } |
636e611c |
121 | |
122 | /** Load up the Language preference **/ |
123 | $user_language = getPref($data_dir, $username, "language"); |
124 | if ($user_language == "") { |
125 | if (isset($default_charset)) |
126 | $user_language = $default_charset; |
127 | else |
128 | $user_language = en; |
129 | } |
130 | |
9d157cec |
131 | // highlightX comes in with the form: name,color,header,value |
132 | for ($i=0; $hlt = getPref($data_dir, $username, "highlight$i"); $i++) { |
133 | $ary = explode(",", $hlt); |
134 | $message_highlight_list[$i]["name"] = $ary[0]; |
135 | $message_highlight_list[$i]["color"] = $ary[1]; |
136 | $message_highlight_list[$i]["value"] = $ary[2]; |
3e69e88b |
137 | $message_highlight_list[$i]["match_type"] = $ary[3]; |
9d157cec |
138 | } |
c36ed9cf |
139 | |
11307a4c |
140 | ?> |