4 +-----------------------------------------------------------------------+
5 | program/steps/settings/save_prefs.inc |
7 | This file is part of the RoundCube Webmail client |
8 | Copyright (C) 2005-2007, RoundCube Dev. - Switzerland |
9 | Licensed under the GNU GPL |
12 | Save user preferences to DB and to the current session |
14 +-----------------------------------------------------------------------+
15 | Author: Thomas Bruederli <roundcube@gmail.com> |
16 +-----------------------------------------------------------------------+
18 $Id: save_prefs.inc 543 2007-04-28 18:07:12Z thomasb $
22 $a_user_prefs = array(
23 'timezone' => isset($_POST['_timezone']) ? floatval($_POST['_timezone']) : $CONFIG['timezone'],
24 'dst_active' => isset($_POST['_dst_active']) ? TRUE : FALSE,
25 'pagesize' => is_numeric($_POST['_pagesize']) ? intval($_POST['_pagesize']) : $CONFIG['pagesize'],
26 'prettydate' => isset($_POST['_pretty_date']) ? TRUE : FALSE,
27 'prefer_html' => isset($_POST['_prefer_html']) ? TRUE : FALSE,
28 'htmleditor' => isset($_POST['_htmleditor']) ? TRUE : FALSE,
29 'preview_pane' => isset($_POST['_preview_pane']) ? TRUE : FALSE,
30 'draft_autosave' => isset($_POST['_draft_autosave']) ? intval($_POST['_draft_autosave']) : 0
33 // don't override these parameters
34 foreach ((array)$CONFIG['dont_override'] as $p)
35 $a_user_prefs[$p] = $CONFIG[$p];
39 if (isset($_POST['_language']))
41 $sess_user_lang = $_SESSION['user_lang'] = get_input_value('_language', RCUBE_INPUT_POST);
42 rcmail_set_locale($sess_user_lang);
45 if (rcmail_save_user_prefs($a_user_prefs))
46 $OUTPUT->show_message('successfullysaved', 'confirmation');
50 rcmail_overwrite_action('preferences');