From 2d93ce28cc4788b426ae06e51c0ef78cb053a4fa Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Sun, 29 Nov 2009 16:53:17 +0000 Subject: [PATCH] "fixed warning in setup and correctly reading config first" --- phpgwapi/inc/class.egw_time.inc.php | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/phpgwapi/inc/class.egw_time.inc.php b/phpgwapi/inc/class.egw_time.inc.php index 1d261fc7a0..85bdb89da7 100644 --- a/phpgwapi/inc/class.egw_time.inc.php +++ b/phpgwapi/inc/class.egw_time.inc.php @@ -398,10 +398,18 @@ class egw_time extends DateTime if (empty($GLOBALS['egw_info']['server']['server_timezone'])) { $config = new config('phpgwapi'); - $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()); + $config->read_repository(); + if ($config->config_data['server_timezone']) + { + $GLOBALS['egw_info']['server']['server_timezone'] = $config->config_data['server_timezone']; + } + else + { + $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']);