thomascube
2011-09-28 801b69d3ab184df5c4e610d19202fc49385d2bd2
Fix timezone settings

2 files modified
12 ■■■■■ changed files
program/include/rcube_config.php 10 ●●●●● patch | view | raw | blame | history
program/js/app.js 2 ●●● patch | view | raw | blame | history
program/include/rcube_config.php
@@ -93,9 +93,8 @@
        
        // 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 @@
    {
        $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 @@
        $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'];
        }
    }
program/js/app.js
@@ -383,7 +383,7 @@
        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 () {