59177427 |
1 | <?php |
ef870322 |
2 | /** |
3 | ** options.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 | ** Displays the options page. Pulls from proper user preference files |
9 | ** and config.php. Displays preferences as selected and other options. |
10 | ** |
245a6892 |
11 | ** $Id$ |
ef870322 |
12 | **/ |
13 | |
ff8a98e7 |
14 | require_once('../src/validate.php'); |
15 | require_once('../functions/display_messages.php'); |
16 | require_once('../functions/imap.php'); |
17 | require_once('../functions/array.php'); |
88fa922a |
18 | |
19 | ereg ("(^.*/)[^/]+/[^/]+$", $PHP_SELF, $regs); |
20 | $base_uri = $regs[1]; |
d3cdb279 |
21 | |
7aaa81fc |
22 | if (isset($language)) { |
88fa922a |
23 | setcookie('squirrelmail_language', $language, time()+2592000, $base_uri); |
c36ed9cf |
24 | $squirrelmail_language = $language; |
37df47f5 |
25 | } |
1e0628fb |
26 | |
e7db48af |
27 | displayPageHeader($color, _("None")); |
f740c049 |
28 | |
c36ed9cf |
29 | ?> |
11307a4c |
30 | |
e9f8ea4e |
31 | <br> |
e7db48af |
32 | <table bgcolor="<?php echo $color[0] ?>" width="95%" align="center" cellpadding="2" cellspacing="0" border="0"> |
33 | <tr><td align="center"> |
34 | |
35 | <b><?php echo _("Options") ?></b><br> |
36 | |
37 | <table width="100%" border="0" cellpadding="5" cellspacing="0"> |
38 | <tr><td bgcolor="<?php echo $color[4] ?>" align="center"> |
c36ed9cf |
39 | |
6170c5b6 |
40 | <?php |
245a6892 |
41 | if (isset($submit_personal)) { |
c36ed9cf |
42 | # Save personal information |
ed21fc85 |
43 | if (isset($full_name)) { |
aaf9abef |
44 | setPref($data_dir, $username, 'full_name', $full_name); |
ed21fc85 |
45 | } |
46 | if (isset($email_address)) { |
aaf9abef |
47 | setPref($data_dir, $username, 'email_address', $email_address); |
ed21fc85 |
48 | } |
49 | if (isset($reply_to)) { |
aaf9abef |
50 | setPref($data_dir, $username, 'reply_to', $reply_to); |
ed21fc85 |
51 | } |
52 | setPref($data_dir, $username, 'reply_citation_style', $new_reply_citation_style); |
53 | setPref($data_dir, $username, 'reply_citation_start', $new_reply_citation_start); |
54 | setPref($data_dir, $username, 'reply_citation_end', $new_reply_citation_end); |
aab2c92c |
55 | if (! isset($usesignature)) |
56 | $usesignature = 0; |
f740c049 |
57 | setPref($data_dir, $username, 'use_signature', $usesignature); |
ed21fc85 |
58 | if (! isset($prefixsig)) { |
f740c049 |
59 | $prefixsig = 0; |
ed21fc85 |
60 | } |
f740c049 |
61 | setPref($data_dir, $username, 'prefix_sig', $prefixsig); |
ed21fc85 |
62 | if (isset($signature_edit)) { |
63 | setSig($data_dir, $username, $signature_edit); |
64 | } |
2848c630 |
65 | |
db5910ac |
66 | do_hook('options_personal_save'); |
ef3c69f0 |
67 | |
e7db48af |
68 | echo '<br><b>'._("Successfully saved personal information!").'</b><br>'; |
f740c049 |
69 | } else if (isset($submit_display)) { |
70 | // Do checking to make sure $chosentheme is in the array |
71 | $in_ary = false; |
72 | for ($i=0; $i < count($theme); $i++) |
73 | { |
74 | if ($theme[$i]['PATH'] == $chosentheme) |
75 | { |
76 | $in_ary = true; |
77 | break; |
78 | } |
79 | } |
80 | if (! $in_ary) |
81 | $chosentheme = ''; |
82 | |
c36ed9cf |
83 | # Save display preferences |
db5910ac |
84 | setPref($data_dir, $username, 'chosen_theme', $chosentheme); |
cd41fc8d |
85 | setPref($data_dir, $username, 'language', $language); |
86 | setPref($data_dir, $username, 'use_javascript_addr_book', $javascript_abook); |
db5910ac |
87 | setPref($data_dir, $username, 'show_num', $shownum); |
88 | setPref($data_dir, $username, 'wrap_at', $wrapat); |
89 | setPref($data_dir, $username, 'editor_size', $editorsize); |
90 | setPref($data_dir, $username, 'left_refresh', $leftrefresh); |
9a732bb6 |
91 | setPref($data_dir, $username, 'location_of_bar', $folder_new_location); |
441f2d33 |
92 | setPref($data_dir, $username, 'location_of_buttons', $button_new_location); |
db5910ac |
93 | setPref($data_dir, $username, 'left_size', $leftsize); |
cd41fc8d |
94 | |
95 | if (isset($altIndexColors) && $altIndexColors == 1) { |
ac53fb56 |
96 | setPref($data_dir, $username, 'alt_index_colors', 1); |
cd41fc8d |
97 | } else { |
ac53fb56 |
98 | setPref($data_dir, $username, 'alt_index_colors', 0); |
cd41fc8d |
99 | } |
100 | |
101 | if (isset($showhtmldefault)) { |
e2ab93e5 |
102 | setPref($data_dir, $username, 'show_html_default', 1); |
cd41fc8d |
103 | } else { |
e2ab93e5 |
104 | removePref($data_dir, $username, 'show_html_default'); |
cd41fc8d |
105 | } |
106 | |
107 | if (isset($includeselfreplyall)) { |
a13cf243 |
108 | setPref($data_dir, $username, 'include_self_reply_all', 1); |
cd41fc8d |
109 | } else { |
a13cf243 |
110 | removePref($data_dir, $username, 'include_self_reply_all'); |
cd41fc8d |
111 | } |
feb563a6 |
112 | |
f1e6f580 |
113 | if (isset($pageselectormax)) { |
114 | setPref($data_dir, $username, 'page_selector_max', $pageselectormax); |
feb563a6 |
115 | } else { |
f1e6f580 |
116 | removePref($data_dir, $username, 'page_selector_max', 0 ); |
117 | } |
118 | |
119 | if (isset($pageselector)) { |
feb563a6 |
120 | removePref($data_dir, $username, 'page_selector'); |
f1e6f580 |
121 | } else { |
122 | setPref($data_dir, $username, 'page_selector', 1); |
feb563a6 |
123 | } |
124 | |
db5910ac |
125 | do_hook('options_display_save'); |
ef3c69f0 |
126 | |
e7db48af |
127 | echo '<br><b>'._("Successfully saved display preferences!").'</b><br>'; |
128 | echo '<a href="../src/webmail.php?right_frame=options.php" target=_top>' . _("Refresh Page") . '</a><br>'; |
245a6892 |
129 | } else if (isset($submit_folder)) { |
c36ed9cf |
130 | # Save folder preferences |
db5910ac |
131 | if ($trash != 'none') { |
132 | setPref($data_dir, $username, 'move_to_trash', true); |
133 | setPref($data_dir, $username, 'trash_folder', $trash); |
c36ed9cf |
134 | } else { |
db5910ac |
135 | setPref($data_dir, $username, 'move_to_trash', '0'); |
136 | setPref($data_dir, $username, 'trash_folder', 'none'); |
9d157cec |
137 | } |
db5910ac |
138 | if ($sent != 'none') { |
139 | setPref($data_dir, $username, 'move_to_sent', true); |
140 | setPref($data_dir, $username, 'sent_folder', $sent); |
c36ed9cf |
141 | } else { |
db5910ac |
142 | setPref($data_dir, $username, 'move_to_sent', '0'); |
143 | setPref($data_dir, $username, 'sent_folder', 'none'); |
8d636967 |
144 | } |
9322386e |
145 | if ($draft != 'none') { |
146 | setPref($data_dir, $username, 'save_as_draft', true); |
147 | setPref($data_dir, $username, 'draft_folder', $draft); |
148 | } else { |
149 | setPref($data_dir, $username, 'save_as_draft', '0'); |
150 | setPref($data_dir, $username, 'draft_folder', 'none'); |
151 | } |
2e950c24 |
152 | if (isset($folderprefix)) { |
8d636967 |
153 | setPref($data_dir, $username, 'folder_prefix', $folderprefix); |
154 | } else { |
155 | setPref($data_dir, $username, 'folder_prefix', ''); |
156 | } |
db5910ac |
157 | setPref($data_dir, $username, 'unseen_notify', $unseennotify); |
158 | setPref($data_dir, $username, 'unseen_type', $unseentype); |
235a65d5 |
159 | if (isset($collapsefolders)) |
160 | setPref($data_dir, $username, 'collapse_folders', $collapsefolders); |
161 | else |
162 | removePref($data_dir, $username, 'collapse_folders'); |
db5910ac |
163 | do_hook('options_folders_save'); |
e7db48af |
164 | echo '<br><b>'._("Successfully saved folder preferences!").'</b><br>'; |
165 | echo '<a href="../src/left_main.php" target=left>' . _("Refresh Folder List") . '</a><br>'; |
6b638171 |
166 | } else { |
db5910ac |
167 | do_hook('options_save'); |
9d157cec |
168 | } |
6b638171 |
169 | |
c36ed9cf |
170 | ?> |
11307a4c |
171 | |
e7db48af |
172 | <table bgcolor="<?php echo $color[4] ?>" width="100%" cellpadding="5" cellspacing="0" border="0"> |
c36ed9cf |
173 | <tr> |
db5910ac |
174 | <td width="50%" valign="top"> |
175 | <table width="100%" cellpadding="3" cellspacing="0" border="0"> |
c36ed9cf |
176 | <tr> |
6170c5b6 |
177 | <td bgcolor="<?php echo $color[9] ?>"> |
178 | <a href="options_personal.php"><?php echo _("Personal Information"); ?></a> |
c36ed9cf |
179 | </td> |
180 | </tr> |
181 | <tr> |
6170c5b6 |
182 | <td bgcolor="<?php echo $color[0] ?>"> |
183 | <?php echo _("This contains personal information about yourself such as your name, your email address, etc.") ?> |
c36ed9cf |
184 | </td> |
185 | </tr> |
186 | </table><br> |
db5910ac |
187 | <table width="100%" cellpadding="3" cellspacing="0" border="0"> |
c36ed9cf |
188 | <tr> |
6170c5b6 |
189 | <td bgcolor="<?php echo $color[9] ?>"> |
190 | <a href="options_highlight.php"><?php echo _("Message Highlighting"); ?></a> |
c36ed9cf |
191 | </td> |
192 | </tr> |
193 | <tr> |
6170c5b6 |
194 | <td bgcolor="<?php echo $color[0] ?>"> |
195 | <?php echo _("Based upon given criteria, incoming messages can have different background colors in the message list. This helps to easily distinguish who the messages are from, especially for mailing lists.") ?> |
c36ed9cf |
196 | </td> |
197 | </tr> |
198 | </table><br> |
db5910ac |
199 | <table width="100%" cellpadding="3" cellspacing="0" border="0"> |
8e265988 |
200 | <tr> |
201 | <td bgcolor="<?php echo $color[9] ?>"> |
202 | <a href="options_order.php"><?php echo _("Index Order"); ?></a> |
203 | </td> |
204 | </tr> |
205 | <tr> |
206 | <td bgcolor="<?php echo $color[0] ?>"> |
207 | <?php echo _("The order of the message index can be rearanged and changed to contain the headers in any order you want.") ?> |
208 | </td> |
209 | </tr> |
210 | </table><br> |
c36ed9cf |
211 | </td> |
db5910ac |
212 | <td valign="top" width="50%"> |
213 | <table width="100%" cellpadding="3" cellspacing="0" border="0"> |
c36ed9cf |
214 | <tr> |
6170c5b6 |
215 | <td bgcolor="<?php echo $color[9] ?>"> |
216 | <a href="options_display.php"><?php echo _("Display Preferences"); ?></a> |
c36ed9cf |
217 | </td> |
218 | </tr> |
219 | <tr> |
6170c5b6 |
220 | <td bgcolor="<?php echo $color[0] ?>"> |
221 | <?php echo _("You can change the way that SquirrelMail looks and displays information to you, such as the colors, the language, and other settings.") ?> |
c36ed9cf |
222 | </td> |
223 | </tr> |
224 | </table><br> |
db5910ac |
225 | <table width="100%" cellpadding="3" cellspacing="0" border="0"> |
c36ed9cf |
226 | <tr> |
6170c5b6 |
227 | <td bgcolor="<?php echo $color[9] ?>"> |
228 | <a href="options_folder.php"><?php echo _("Folder Preferences"); ?></a> |
c36ed9cf |
229 | </td> |
230 | </tr> |
231 | <tr> |
6170c5b6 |
232 | <td bgcolor="<?php echo $color[0] ?>"> |
233 | <?php echo _("These settings change the way your folders are displayed and manipulated.") ?> |
c36ed9cf |
234 | </td> |
235 | </tr> |
236 | </table><br> |
237 | </td> |
238 | </tr> |
239 | </table> |
e7db48af |
240 | |
241 | <?php do_hook('options_link_and_description'); ?> |
242 | |
243 | |
244 | </td></tr> |
245 | </table> |
246 | |
247 | </td></tr> |
248 | </table> |
249 | |
9322386e |
250 | </body></html> |