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