From 745ef3df6e874e2c11ba1e5b3a7bf13bc129ed0f Mon Sep 17 00:00:00 2001 From: thomasb Date: Thu, 25 Aug 2011 20:09:36 +0000 Subject: 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 --- roundcubemail/program/include/rcube_config.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'roundcubemail/program/include/rcube_config.php') 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. -- cgit v1.2.3