"fixed warning in setup and correctly reading config first"

This commit is contained in:
Ralf Becker 2009-11-29 16:53:17 +00:00
parent a0e1a238dd
commit 2d93ce28cc

View File

@ -398,10 +398,18 @@ class egw_time extends DateTime
if (empty($GLOBALS['egw_info']['server']['server_timezone'])) if (empty($GLOBALS['egw_info']['server']['server_timezone']))
{ {
$config = new config('phpgwapi'); $config = new config('phpgwapi');
$config->save_value('server_timezone', $config->read_repository();
$GLOBALS['egw_info']['server']['server_timezone'] = date_default_timezone_get()); if ($config->config_data['server_timezone'])
$config->save_repository(); {
error_log(__METHOD__."() stored server_timezone=".date_default_timezone_get()); $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']); date_default_timezone_set($GLOBALS['egw_info']['server']['server_timezone']);