From: cajus Date: Thu, 20 Sep 2007 12:08:32 +0000 (+0000) Subject: Added TZ fix X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=257502665afab3a2ca47223de97fe4fb909002ed;p=gosa.git Added TZ fix git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7352 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/include/functions.inc b/include/functions.inc index cb48b17f2..ba51ca911 100644 --- a/include/functions.inc +++ b/include/functions.inc @@ -2679,43 +2679,13 @@ function get_default_timezone($stamp = NULL) $tz = $config->data['MAIN']['TIMEZONE']; } - /* Check if we could use the PHP5 default timezone functions */ - if(function_exists("date_default_timezone_set")){ - if(!@date_default_timezone_set($tz)){ - print_red(sprintf(_("The timezone setting \"".$tz."\" in your gosa.conf is not valid. Can not calculate correct timezone offest."),$tz)); - } - $tz_delta = date("Z", $stamp); - $tz_delta = $tz_delta / 3600 ; - return(array("name" => $tz, "value" => $tz_delta)); - - }else{ - - /* We can't use the PHP integrated functions - * so we use the zone informations returned by _get_tz_zones - * and calculate the the zone offset. - */ - $tmp = _get_tz_zones(); - $zones = $tmp['TIMEZONES']; - $dst_zones = $tmp['DST_ZONES']; - - /* Detect zone and calculate offset */ - $found = FALSE; - foreach($zones as $name => $value){ - if(preg_match("#".normalizePreg($name)."#i",$tz)){ - $offset = $value / 3600 ; - if(isset($dst_zones[$name]) && (date("I",$stamp) == 1)){ - $offset ++; - } - $zone = array("name" => $name, "value" => $offset); - $found = TRUE; - break; - } - } - if(!$found){ - print_red(sprintf(_("The timezone setting \"".$tz."\" in your gosa.conf is not valid. Can not calculate correct timezone offest."), -$tz)); - } + if(!@date_default_timezone_set($tz)){ + print_red(sprintf(_("The timezone setting \"".$tz."\" in your gosa.conf is not valid. Can not calculate correct timezone offest."),$tz)); } + $tz_delta = date("Z", $stamp); + $tz_delta = $tz_delta / 3600 ; + return(array("name" => $tz, "value" => $tz_delta)); + } return($zone); } diff --git a/include/php_setup.inc b/include/php_setup.inc index 096518f09..98f8db709 100644 --- a/include/php_setup.inc +++ b/include/php_setup.inc @@ -49,11 +49,6 @@ function gosaRaiseError($errno, $errstr, $errfile, $errline) return; } - /* FIXME: Same as above. Compatibility does error flooding.*/ - if (preg_match('/zend.ze1_compatibility_mode/', $errstr)){ - return; - } - /* Hide ldap size limit messages */ if (preg_match('/ldap_error/', $errstr)){ if (preg_match('/sizelimit/', $errstr)){ @@ -82,8 +77,6 @@ function gosaRaiseError($errno, $errstr, $errfile, $errline) "\n\n". "*** GOsa bug report ***". "\nGOsa Version: ".get_gosa_version(). - "\nDate: ".date("d.m.Y"). - "\nTime: ".date("H:i:s"). "\n\n". "Please describe what you did to produce this error as detailed as possible. Can you ". "reproduce this bug using the demo on http://www.gosa-project.org ?". @@ -247,9 +240,7 @@ $smarty->caching= false; $smarty->php_handling= SMARTY_PHP_REMOVE; /* Set timezone */ -if (function_exists("date_default_timezone_set")){ - date_default_timezone_set("GMT"); -} +date_default_timezone_set("GMT"); // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: ?>