Code

Added error message for php4 handling of zones.
[gosa.git] / include / class_timezones.inc
index 1b30d53f200de1672542637e107fa0b8021b0c16..8c3ae9969804e73d1ce49fb28448e973096ffc34 100644 (file)
@@ -67,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 ;
@@ -74,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);