diff options
author | Thomas Bruederli <thomas@roundcube.net> | 2014-02-10 13:18:34 +0100 |
---|---|---|
committer | Thomas Bruederli <thomas@roundcube.net> | 2014-02-10 13:18:34 +0100 |
commit | ce2019426600b8d235c0e60cb4b1223eb984e311 (patch) | |
tree | d80cc2fe33589f70e1412fefc62ff95e94677948 /program/lib/Roundcube/rcube.php | |
parent | c8699f09eae6265e566a18c4597334d363aa4492 (diff) |
Add setter for user object to rcube class; we already have getters for various user properties there
Diffstat (limited to 'program/lib/Roundcube/rcube.php')
-rw-r--r-- | program/lib/Roundcube/rcube.php | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/program/lib/Roundcube/rcube.php b/program/lib/Roundcube/rcube.php index d58eb087b..69d95f023 100644 --- a/program/lib/Roundcube/rcube.php +++ b/program/lib/Roundcube/rcube.php @@ -3,8 +3,8 @@ /* +-----------------------------------------------------------------------+ | This file is part of the Roundcube Webmail client | - | Copyright (C) 2008-2012, The Roundcube Dev Team | - | Copyright (C) 2011-2012, Kolab Systems AG | + | Copyright (C) 2008-2014, The Roundcube Dev Team | + | Copyright (C) 2011-2014, Kolab Systems AG | | | | Licensed under the GNU General Public License version 3 or | | any later version with exceptions for skins & plugins. | @@ -94,6 +94,13 @@ class rcube */ public $plugins; + /** + * Instance of rcube_user class. + * + * @var rcube_user + */ + public $user; + /* private/protected vars */ protected $texts; @@ -1302,6 +1309,20 @@ class rcube self::write_log($dest, sprintf("%s: %0.4f sec", $label, $diff)); } + /** + * Setter for system user object + * + * @param rcube_user Current user instance + */ + public function set_user($user) + { + if (is_object($user)) { + $this->user = $user; + + // overwrite config with user preferences + $this->config->set_user_prefs((array)$this->user->get_prefs()); + } + } /** * Getter for logged user ID. |