diff --git a/phpgwapi/inc/class.egw.inc.php b/phpgwapi/inc/class.egw.inc.php index 8f7b1156ed..8a2b4e55ee 100644 --- a/phpgwapi/inc/class.egw.inc.php +++ b/phpgwapi/inc/class.egw.inc.php @@ -125,6 +125,19 @@ class egw extends egw_minimal } //$GLOBALS['egw_info']['server'] = config::read('phpgwapi'); would unserialize arrays + // if no server timezone set, use date_default_timezone_get() to determine it once + // it fills to log with deprecated warnings under 5.3 otherwise + if (empty($GLOBALS['egw_info']['server']['server_timezone'])) + { + $config = new config('phpgwapi'); + $config->read_repository(); + $config->save_value('server_timezone', + $GLOBALS['egw_info']['server']['server_timezone'] = date_default_timezone_get()); + $config->save_repository(); + error_log(__METHOD__."() stored server_timezone=".date_default_timezone_get()); + } + date_default_timezone_set($GLOBALS['egw_info']['server']['server_timezone']); + // setup the other subclasses $this->translation = new translation(); $this->common = new common(); @@ -174,7 +187,12 @@ class egw extends egw_minimal { $this->db->Link_ID->SetCharSet($GLOBALS['egw_info']['server']['system_charset']); } - + // restoring server timezone, to avoid warnings under php5.3 + if (empty($GLOBALS['egw_info']['server']['server_timezone'])) + { + + date_default_timezone_set($GLOBALS['egw_info']['server']['server_timezone']); + } register_shutdown_function(array($this, 'shutdown')); $this->define_egw_constants(); diff --git a/setup/inc/class.setup_process.inc.php b/setup/inc/class.setup_process.inc.php index 1e2022dfcb..edb116200d 100755 --- a/setup/inc/class.setup_process.inc.php +++ b/setup/inc/class.setup_process.inc.php @@ -228,6 +228,9 @@ $current_config['tz_offset'] = $datetime->getbestguess(); unset($datetime); + // storing default timezone as system timezone + $current_config['system_timezone'] = date_default_timezone_get(); + // RalfBecker: php.net recommend this for security reasons, it should be our default too $current_config['usecookies'] = 'True';