diff options
author | thomascube <thomas@roundcube.net> | 2011-08-25 20:09:36 +0000 |
---|---|---|
committer | thomascube <thomas@roundcube.net> | 2011-08-25 20:09:36 +0000 |
commit | da71783bc95f786968955a865943f6052eca83a4 (patch) | |
tree | 08d8837e970fae554fc59ac000150c37cf5350fa /program/include/rcube_config.php | |
parent | 1a716d2d343b6614bec80d98cc46f327c296279e (diff) |
Move timezone computation to rcube_config; don't override SESSION['timezone'] when saving prefs
Diffstat (limited to 'program/include/rcube_config.php')
-rw-r--r-- | program/include/rcube_config.php | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/program/include/rcube_config.php b/program/include/rcube_config.php index 9379e9e7b..31b7ed6b7 100644 --- a/program/include/rcube_config.php +++ b/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. |