X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=include%2Fclass_timezones.inc;h=8c3ae9969804e73d1ce49fb28448e973096ffc34;hb=2dd0610553775a07cd552ccdcbbf650a18794a8c;hp=3c2534dd052adee4f15a6133b51bafb1feb16d4e;hpb=df8eb3b3c0ce5e3bd4761b2ecb6c490112860d51;p=gosa.git diff --git a/include/class_timezones.inc b/include/class_timezones.inc index 3c2534dd0..8c3ae9969 100644 --- a/include/class_timezones.inc +++ b/include/class_timezones.inc @@ -49,7 +49,9 @@ function get_default_timezone($stamp = NULL) /* Check if we could use the PHP5 default timezone functions */ if(function_exists("date_default_timezone_set")){ - date_default_timezone_set($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)); @@ -65,6 +67,7 @@ function get_default_timezone($stamp = NULL) $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 ; @@ -72,8 +75,14 @@ function get_default_timezone($stamp = NULL) $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)); + } } } return($zone);