source: subversion/trunk/roundcubemail/program/steps/settings/save_prefs.inc @ 1536

Last change on this file since 1536 was 1536, checked in by alec, 5 years ago
  • Added option to disable displaying of attached images below the message body
  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.8 KB
Line 
1<?php
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-2007, RoundCube Dev. - Switzerland                 |
9 | Licensed under the GNU GPL                                            |
10 |                                                                       |
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 = 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']) ? max(2, intval($_POST['_pagesize'])) : $CONFIG['pagesize'],
26  'prettydate'   => isset($_POST['_pretty_date']) ? TRUE : FALSE,
27  'prefer_html'  => isset($_POST['_prefer_html']) ? TRUE : FALSE,
28  'addrbook_show_images' => isset($_POST['_addrbook_show_images']) ? TRUE : FALSE,
29  'htmleditor'   => isset($_POST['_htmleditor']) ? TRUE : FALSE,
30  'inline_images'   => isset($_POST['_inline_images']) ? TRUE : FALSE,
31  'preview_pane' => isset($_POST['_preview_pane']) ? TRUE : FALSE,
32  'read_when_deleted' => isset($_POST['_read_when_deleted']) ? TRUE : FALSE,
33  'flag_for_deletion' => isset($_POST['_flag_for_deletion']) ? TRUE : FALSE,
34  'logout_purge' => isset($_POST['_logout_purge']) ? TRUE : FALSE,
35  'logout_expunge' => isset($_POST['_logout_expunge']) ? TRUE : FALSE,
36  'draft_autosave' => isset($_POST['_draft_autosave']) ? intval($_POST['_draft_autosave']) : 0,
37  'mdn_requests' => isset($_POST['_mdn_requests']) ? intval($_POST['_mdn_requests']) : 0,
38  );
39
40// don't override these parameters
41foreach ((array)$CONFIG['dont_override'] as $p)
42  $a_user_prefs[$p] = $CONFIG[$p];
43
44
45// switch UI language
46if (isset($_POST['_language'])) {
47  $RCMAIL->load_language(get_input_value('_language', RCUBE_INPUT_POST));
48}
49
50// force min size
51if ($a_user_prefs['pagesize'] < 1)
52  $a_user_prefs['pagesize'] = 10;
53
54if (isset($CONFIG['max_pagesize']) && ($a_user_prefs['pagesize'] > $CONFIG['max_pagesize']))
55  $a_user_prefs['pagesize'] = (int) $CONFIG['max_pagesize'];
56
57if ($USER->save_prefs($a_user_prefs))
58  $OUTPUT->show_message('successfullysaved', 'confirmation');
59
60
61// go to next step
62rcmail_overwrite_action('preferences');
63
64?>
Note: See TracBrowser for help on using the repository browser.