commit | author | age
|
4e17e6
|
1 |
<?php |
T |
2 |
|
|
3 |
/* |
|
4 |
+-----------------------------------------------------------------------+ |
|
5 |
| program/steps/settings/save_prefs.inc | |
|
6 |
| | |
|
7 |
| This file is part of the RoundCube Webmail client | |
|
8 |
| Copyright (C) 2005, RoundCube Dev. - Switzerland | |
30233b
|
9 |
| Licensed under the GNU GPL | |
4e17e6
|
10 |
| | |
T |
11 |
| PURPOSE: | |
|
12 |
| Save user preferences to DB and to the current session | |
|
13 |
| | |
|
14 |
+-----------------------------------------------------------------------+ |
|
15 |
| Author: Thomas Bruederli <roundcube@gmail.com> | |
|
16 |
+-----------------------------------------------------------------------+ |
|
17 |
|
|
18 |
$Id$ |
|
19 |
|
|
20 |
*/ |
|
21 |
|
|
22 |
$a_user_prefs = $_SESSION['user_prefs']; |
|
23 |
if (!is_array($a_user_prefs)) |
|
24 |
$a_user_prefs = array(); |
|
25 |
|
|
26 |
|
4b5d2d
|
27 |
$a_user_prefs['timezone'] = isset($_POST['_timezone']) ? floatval($_POST['_timezone']) : $CONFIG['timezone']; |
4647e1
|
28 |
$a_user_prefs['dst_active'] = isset($_POST['_dst_active']) ? TRUE : FALSE; |
4e17e6
|
29 |
$a_user_prefs['pagesize'] = is_numeric($_POST['_pagesize']) ? (int)$_POST['_pagesize'] : $CONFIG['pagesize']; |
T |
30 |
$a_user_prefs['prefer_html'] = isset($_POST['_prefer_html']) ? TRUE : FALSE; |
a0109c
|
31 |
$a_user_prefs['htmleditor'] = isset($_POST['_htmleditor']) ? TRUE : FALSE; |
d656f1
|
32 |
$a_user_prefs['draft_autosave'] = isset($_POST['_draft_autosave']) ? intval($_POST['_draft_autosave']) : 0; |
4e17e6
|
33 |
|
30233b
|
34 |
// MM: Date format toggle (Pretty / Standard) |
T |
35 |
$a_user_prefs['prettydate'] = isset($_POST['_pretty_date']) ? TRUE : FALSE; |
|
36 |
|
4e17e6
|
37 |
if (isset($_POST['_language'])) |
7cc38e
|
38 |
{ |
d656f1
|
39 |
$sess_user_lang = $_SESSION['user_lang'] = get_input_value('_language', RCUBE_INPUT_POST); |
7cc38e
|
40 |
rcmail_set_locale($sess_user_lang); |
T |
41 |
} |
4e17e6
|
42 |
|
86f172
|
43 |
if (rcmail_save_user_prefs($a_user_prefs)) |
4e17e6
|
44 |
show_message('successfullysaved', 'confirmation'); |
T |
45 |
|
|
46 |
|
|
47 |
// go to next step |
|
48 |
$_action = 'preferences'; |
|
49 |
|
|
50 |
// overwrite action variable |
|
51 |
$OUTPUT->add_script(sprintf("\n%s.set_env('action', '%s');", $JS_OBJECT_NAME, $_action)); |
|
52 |
|
a0109c
|
53 |
?> |