if any of the standard headers are blank, read_body.php doesn't show
[squirrelmail.git] / src / options.php
1 <?php
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
13 session_start();
14
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");
27 if (!isset($i18n_php))
28 include("../functions/i18n.php");
29 if (!isset($auth_php))
30 include ("../functions/auth.php");
31
32 if (isset($language)) {
33 setcookie("squirrelmail_language", $language, time()+2592000);
34 $squirrelmail_language = $language;
35 }
36
37 include("../src/load_prefs.php");
38 displayPageHeader($color, "None");
39 is_logged_in();
40 ?>
41
42 <br>
43 <table width=95% align=center cellpadding=2 cellspacing=2 border=0>
44 <tr><td bgcolor="<?php echo $color[0] ?>">
45 <center><b><?php echo _("Options") ?></b></center>
46 </td></tr></table>
47
48 <?php
49 if ($submit_personal) {
50 # Save personal information
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));
56
57 do_hook("options_personal_save");
58
59 echo "<br><center><b>"._("Successfully saved personal information!")."</b></center><br>";
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);
68 setPref($data_dir, $username, "left_size", $leftsize);
69 setPref($data_dir, $username, "use_javascript_addr_book", $javascript_abook);
70
71 do_hook("options_display_save");
72
73 echo "<center><table width=90% cellpadding=2 cellspacing=0 border=0 bgcolor=\"$color[2]\"><tr><td>";
74 ecHO "<table width=100% cellpadding=5 cellspacing=0 border=0 bgcolor=\"$color[4]\"><tr><td>";
75 echo "<br><center><b>"._("Successfully saved display preferences!")."</b><br>";
76 echo "<a href=\"webmail.php?right_frame=options.php\" target=_top>"._("Refresh Page")."</a></center><br>";
77 echo "</td></tr></table>";
78 echo "</td></tr></table></center>";
79 } else if ($submit_folder) {
80 # Save folder preferences
81 if ($trash != "none") {
82 setPref($data_dir, $username, "move_to_trash", true);
83 setPref($data_dir, $username, "trash_folder", $trash);
84 } else {
85 setPref($data_dir, $username, "move_to_trash", "0");
86 setPref($data_dir, $username, "trash_folder", "none");
87 }
88 if ($sent != "none") {
89 setPref($data_dir, $username, "move_to_sent", true);
90 setPref($data_dir, $username, "sent_folder", $sent);
91 } else {
92 setPref($data_dir, $username, "move_to_sent", "0");
93 setPref($data_dir, $username, "sent_folder", "none");
94 }
95 setPref($data_dir, $username, "folder_prefix", $folderprefix);
96 setPref($data_dir, $username, "unseen_notify", $unseennotify);
97 setPref($data_dir, $username, "unseen_type", $unseentype);
98 do_hook("options_folders_save");
99 echo "<center><table width=90% cellpadding=2 cellspacing=0 border=0 bgcolor=\"$color[2]\"><tr><td>";
100 ecHO "<table width=100% cellpadding=5 cellspacing=0 border=0 bgcolor=\"$color[4]\"><tr><td>";
101 echo "<br><center><b>"._("Successfully saved folder preferences!")."</b><br>";
102 echo "<a href=\"left_main.php\" target=left>"._("Refresh Folders")."</a></center><br>";
103 echo "</td></tr></table>";
104 echo "</td></tr></table></center>";
105 } else {
106 do_hook("options_save");
107 }
108
109 ?>
110
111
112 <table width=90% cellpadding=0 cellspacing=10 border=0 align=center>
113 <tr>
114 <td width=50% valign=top>
115 <table width=100% cellpadding=3 cellspacing=0 border=0>
116 <tr>
117 <td bgcolor="<?php echo $color[9] ?>">
118 <a href="options_personal.php"><?php echo _("Personal Information"); ?></a>
119 </td>
120 </tr>
121 <tr>
122 <td bgcolor="<?php echo $color[0] ?>">
123 <?php echo _("This contains personal information about yourself such as your name, your email address, etc.") ?>
124 </td>
125 </tr>
126 </table><br>
127 <table width=100% cellpadding=3 cellspacing=0 border=0>
128 <tr>
129 <td bgcolor="<?php echo $color[9] ?>">
130 <a href="options_highlight.php"><?php echo _("Message Highlighting"); ?></a>
131 </td>
132 </tr>
133 <tr>
134 <td bgcolor="<?php echo $color[0] ?>">
135 <?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.") ?>
136 </td>
137 </tr>
138 </table><br>
139 </td>
140 <td valign=top width=50%>
141 <table width=100% cellpadding=3 cellspacing=0 border=0>
142 <tr>
143 <td bgcolor="<?php echo $color[9] ?>">
144 <a href="options_display.php"><?php echo _("Display Preferences"); ?></a>
145 </td>
146 </tr>
147 <tr>
148 <td bgcolor="<?php echo $color[0] ?>">
149 <?php echo _("You can change the way that SquirrelMail looks and displays information to you, such as the colors, the language, and other settings.") ?>
150 </td>
151 </tr>
152 </table><br>
153 <table width=100% cellpadding=3 cellspacing=0 border=0>
154 <tr>
155 <td bgcolor="<?php echo $color[9] ?>">
156 <a href="options_folder.php"><?php echo _("Folder Preferences"); ?></a>
157 </td>
158 </tr>
159 <tr>
160 <td bgcolor="<?php echo $color[0] ?>">
161 <?php echo _("These settings change the way your folders are displayed and manipulated.") ?>
162 </td>
163 </tr>
164 </table><br>
165 </td>
166 </tr>
167 </table>
168 <?php
169 do_hook("options_link_and_description")
170 ?>
171 </body></html>