| 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 | ** $Id$ |
| 12 | **/ |
| 13 | |
| 14 | session_start(); |
| 15 | |
| 16 | if (!isset($strings_php)) |
| 17 | include('../functions/strings.php'); |
| 18 | if (!isset($config_php)) |
| 19 | include('../config/config.php'); |
| 20 | if (!isset($page_header_php)) |
| 21 | include('../functions/page_header.php'); |
| 22 | if (!isset($display_messages_php)) |
| 23 | include('../functions/display_messages.php'); |
| 24 | if (!isset($imap_php)) |
| 25 | include('../functions/imap.php'); |
| 26 | if (!isset($array_php)) |
| 27 | include('../functions/array.php'); |
| 28 | if (!isset($i18n_php)) |
| 29 | include('../functions/i18n.php'); |
| 30 | if (!isset($auth_php)) |
| 31 | include ('../functions/auth.php'); |
| 32 | |
| 33 | if (isset($language)) { |
| 34 | setcookie('squirrelmail_language', $language, time()+2592000); |
| 35 | $squirrelmail_language = $language; |
| 36 | } |
| 37 | |
| 38 | include('../src/load_prefs.php'); |
| 39 | displayPageHeader($color, 'None'); |
| 40 | is_logged_in(); |
| 41 | ?> |
| 42 | |
| 43 | <br> |
| 44 | <table width="95%" align="center" cellpadding="2" cellspacing="2" border="0"> |
| 45 | <tr><td bgcolor="<?php echo $color[0] ?>"> |
| 46 | <center><b><?php echo _("Options") ?></b></center> |
| 47 | </td></tr></table> |
| 48 | |
| 49 | <?php |
| 50 | if (isset($submit_personal)) { |
| 51 | # Save personal information |
| 52 | if (isset($full_name)) setPref($data_dir, $username, 'full_name', $full_name); |
| 53 | if (isset($email_address)) setPref($data_dir, $username, 'email_address', $email_address); |
| 54 | if (isset($reply_to)) setPref($data_dir, $username, 'reply_to', $reply_to); |
| 55 | setPref($data_dir, $username, 'use_signature', $usesignature); |
| 56 | if (isset($signature_edit)) setSig($data_dir, $username, $signature_edit); |
| 57 | |
| 58 | do_hook('options_personal_save'); |
| 59 | |
| 60 | echo '<br><center><b>'._("Successfully saved personal information!").'</b></center><br>'; |
| 61 | } else if (isset($submit_display)) { |
| 62 | # Save display preferences |
| 63 | setPref($data_dir, $username, 'chosen_theme', $chosentheme); |
| 64 | setPref($data_dir, $username, 'show_num', $shownum); |
| 65 | setPref($data_dir, $username, 'wrap_at', $wrapat); |
| 66 | setPref($data_dir, $username, 'editor_size', $editorsize); |
| 67 | setPref($data_dir, $username, 'left_refresh', $leftrefresh); |
| 68 | setPref($data_dir, $username, 'language', $language); |
| 69 | setPref($data_dir, $username, 'location_of_bar', $folder_new_location); |
| 70 | setPref($data_dir, $username, 'location_of_buttons', $button_new_location); |
| 71 | setPref($data_dir, $username, 'left_size', $leftsize); |
| 72 | setPref($data_dir, $username, 'use_javascript_addr_book', $javascript_abook); |
| 73 | |
| 74 | do_hook('options_display_save'); |
| 75 | |
| 76 | echo '<br><center><b>'._("Successfully saved display preferences!").'</b><br>'; |
| 77 | echo '<a href="../src/webmail.php" target=_top>' . _("Refresh Page") . '</a></center><br>'; |
| 78 | } else if (isset($submit_folder)) { |
| 79 | # Save folder preferences |
| 80 | if ($trash != 'none') { |
| 81 | setPref($data_dir, $username, 'move_to_trash', true); |
| 82 | setPref($data_dir, $username, 'trash_folder', $trash); |
| 83 | } else { |
| 84 | setPref($data_dir, $username, 'move_to_trash', '0'); |
| 85 | setPref($data_dir, $username, 'trash_folder', 'none'); |
| 86 | } |
| 87 | if ($sent != 'none') { |
| 88 | setPref($data_dir, $username, 'move_to_sent', true); |
| 89 | setPref($data_dir, $username, 'sent_folder', $sent); |
| 90 | } else { |
| 91 | setPref($data_dir, $username, 'move_to_sent', '0'); |
| 92 | setPref($data_dir, $username, 'sent_folder', 'none'); |
| 93 | } |
| 94 | if (isset($folderprefix)) |
| 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 | if (isset($collapsefolders)) |
| 99 | setPref($data_dir, $username, 'collapse_folders', $collapsefolders); |
| 100 | else |
| 101 | removePref($data_dir, $username, 'collapse_folders'); |
| 102 | do_hook('options_folders_save'); |
| 103 | echo '<br><center><b>'._("Successfully saved folder preferences!").'</b><br>'; |
| 104 | echo '<a href="../src/left_main.php" target=left>' . _("Refresh Folder List") . '</a></center><br>'; |
| 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 | <table width="100%" cellpadding="3" cellspacing="0" border="0"> |
| 140 | <tr> |
| 141 | <td bgcolor="<?php echo $color[9] ?>"> |
| 142 | <a href="options_order.php"><?php echo _("Index Order"); ?></a> |
| 143 | </td> |
| 144 | </tr> |
| 145 | <tr> |
| 146 | <td bgcolor="<?php echo $color[0] ?>"> |
| 147 | <?php echo _("The order of the message index can be rearanged and changed to contain the headers in any order you want.") ?> |
| 148 | </td> |
| 149 | </tr> |
| 150 | </table><br> |
| 151 | </td> |
| 152 | <td valign="top" width="50%"> |
| 153 | <table width="100%" cellpadding="3" cellspacing="0" border="0"> |
| 154 | <tr> |
| 155 | <td bgcolor="<?php echo $color[9] ?>"> |
| 156 | <a href="options_display.php"><?php echo _("Display Preferences"); ?></a> |
| 157 | </td> |
| 158 | </tr> |
| 159 | <tr> |
| 160 | <td bgcolor="<?php echo $color[0] ?>"> |
| 161 | <?php echo _("You can change the way that SquirrelMail looks and displays information to you, such as the colors, the language, and other settings.") ?> |
| 162 | </td> |
| 163 | </tr> |
| 164 | </table><br> |
| 165 | <table width="100%" cellpadding="3" cellspacing="0" border="0"> |
| 166 | <tr> |
| 167 | <td bgcolor="<?php echo $color[9] ?>"> |
| 168 | <a href="options_folder.php"><?php echo _("Folder Preferences"); ?></a> |
| 169 | </td> |
| 170 | </tr> |
| 171 | <tr> |
| 172 | <td bgcolor="<?php echo $color[0] ?>"> |
| 173 | <?php echo _("These settings change the way your folders are displayed and manipulated.") ?> |
| 174 | </td> |
| 175 | </tr> |
| 176 | </table><br> |
| 177 | </td> |
| 178 | </tr> |
| 179 | </table> |
| 180 | <?php |
| 181 | do_hook('options_link_and_description') |
| 182 | ?> |
| 183 | </body></html> |