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