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