summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorthomascube <thomas@roundcube.net>2011-09-28 14:21:41 +0000
committerthomascube <thomas@roundcube.net>2011-09-28 14:21:41 +0000
commit801b69d3ab184df5c4e610d19202fc49385d2bd2 (patch)
tree7fdb327ab86f783ca065662a4706db6348ad4831
parent4037d38873327a2ae15cf653fd643d8efe83929a (diff)
Fix timezone settings
-rw-r--r--program/include/rcube_config.php10
-rw-r--r--program/js/app.js2
2 files changed, 7 insertions, 5 deletions
diff --git a/program/include/rcube_config.php b/program/include/rcube_config.php
index 4e402354d..1c8e23733 100644
--- a/program/include/rcube_config.php
+++ b/program/include/rcube_config.php
@@ -93,9 +93,8 @@ class rcube_config
// set timezone auto settings values
if ($this->prop['timezone'] == 'auto') {
- $this->prop['_timezone_auto'] = true;
$this->prop['dst_active'] = intval(date('I'));
- $this->prop['timezone'] = date('Z') / 3600 - $this->prop['dst_active'];
+ $this->prop['_timezone_value'] = date('Z') / 3600 - $this->prop['dst_active'];
}
// export config data
@@ -159,6 +158,9 @@ class rcube_config
{
$result = isset($this->prop[$name]) ? $this->prop[$name] : $def;
$rcmail = rcmail::get_instance();
+
+ if ($name == 'timezone' && isset($this->prop['_timezone_value']))
+ $result = $this->prop['_timezone_value'];
if (is_object($rcmail->plugins)) {
$plugin = $rcmail->plugins->exec_hook('config_get', array(
@@ -216,8 +218,8 @@ class rcube_config
$this->prop = array_merge($this->prop, $prefs);
// override timezone settings with client values
- if ($this->prop['_timezone_auto']) {
- $this->prop['timezone'] = isset($_SESSION['timezone']) ? $_SESSION['timezone'] : $this->prop['timezone'];
+ if ($this->prop['timezone'] == 'auto') {
+ $this->prop['_timezone_value'] = isset($_SESSION['timezone']) ? $_SESSION['timezone'] : $this->prop['_timezone_value'];
$this->prop['dst_active'] = isset($_SESSION['dst_active']) ? $_SESSION['dst_active'] : $this->prop['dst_active'];
}
}
diff --git a/program/js/app.js b/program/js/app.js
index 1a8d96793..d2760b439 100644
--- a/program/js/app.js
+++ b/program/js/app.js
@@ -383,7 +383,7 @@ function rcube_webmail()
var tz = new Date().getTimezoneOffset() / -60;
var stdtz = new Date().getStdTimezoneOffset() / -60;
$('#rcmlogintz').val(stdtz);
- $('#rcmlogindst').val(tz > stdtz ? 0 : 0);
+ $('#rcmlogindst').val(tz > stdtz ? 1 : 0);
// display 'loading' message on form submit, lock submit button
$('form').submit(function () {