diff options
| author | thomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2011-08-25 20:09:36 +0000 |
|---|---|---|
| committer | thomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2011-08-25 20:09:36 +0000 |
| commit | 745ef3df6e874e2c11ba1e5b3a7bf13bc129ed0f (patch) | |
| tree | 13e0f09e763901178b2a1501e952b4a9c20911fd /roundcubemail/program/include/rcube_config.php | |
| parent | b37de6243f71dd669f799d2b835cb50c67c42da8 (diff) | |
Move timezone computation to rcube_config; don't override SESSION['timezone'] when saving prefs
git-svn-id: https://svn.roundcube.net/trunk@5132 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/include/rcube_config.php')
| -rw-r--r-- | roundcubemail/program/include/rcube_config.php | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/roundcubemail/program/include/rcube_config.php b/roundcubemail/program/include/rcube_config.php index 9379e9e7b..31b7ed6b7 100644 --- a/roundcubemail/program/include/rcube_config.php +++ b/roundcubemail/program/include/rcube_config.php @@ -220,6 +220,19 @@ class rcube_config return $this->prop; } + /** + * Special getter for user's timezone + */ + public function get_timezone() + { + $tz = $this->get('timezone'); + if ($tz == 'auto') + $tz = isset($_SESSION['timezone']) ? $_SESSION['timezone'] : date('Z') / 3600; + else + $tz = intval($tz) + intval($this->get('dst_active')); + + return $tz; + } /** * Return requested DES crypto key. |
