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