4 +-----------------------------------------------------------------------+
5 | program/steps/utils/save_pref.inc |
7 | This file is part of the Roundcube Webmail client |
8 | Copyright (C) 2005-2010, The Roundcube Dev Team |
9 | Licensed under the GNU GPL |
12 | Save preferences setting in database |
14 +-----------------------------------------------------------------------+
15 | Author: Aleksander Machniak <alec@alec.pl> |
16 +-----------------------------------------------------------------------+
18 $Id: save_pref.inc 4410 2011-01-12 18:25:02Z thomasb $
22 $name = get_input_value('_name', RCUBE_INPUT_POST);
23 $value = get_input_value('_value', RCUBE_INPUT_POST);
25 // save preference value
26 $RCMAIL->user->save_prefs(array($name => $value));
28 // update also session if requested
29 if ($sessname = get_input_value('_session', RCUBE_INPUT_POST)) {
30 // Support multidimensional arrays...
31 $vars = explode('/', $sessname);
34 if (count($vars) == 1)
35 $_SESSION[$vars[0]] = $value;
36 else if (count($vars) == 2)
37 $_SESSION[$vars[0]][$vars[1]] = $value;
38 else if (count($vars) == 3)
39 $_SESSION[$vars[0]][$vars[1]][$vars[2]] = $value;