Code

Udpated Zone editor
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 27 Jun 2007 09:41:39 +0000 (09:41 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 27 Jun 2007 09:41:39 +0000 (09:41 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@6719 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/systems/class_servDNSeditZone.inc

index 212a41bdc7258ca353630152549b0fba0c5e48dc..db855482143ddd65a6fc7339fc6b3b7e0d059994 100644 (file)
@@ -61,6 +61,7 @@ class servdnseditZone extends plugin
     }else{
       $this->ZoneObject         = $attrs;
 
+
       $this->OldZoneName        = $attrs['zoneName'];
       $this->OldReverseZone     = $attrs['ReverseZone'];
 
@@ -72,6 +73,12 @@ class servdnseditZone extends plugin
       foreach($this->attributes as $value){
         $this->$value = $attrs[$value];
       }
+
+      $this->sOAmail            = preg_replace("/\./","@",$this->sOAmail,1);
+      $this->sOAmail            = preg_replace("/\.$/","",$this->sOAmail);
+      $this->sOAprimary         = preg_replace("/\.$/","",$this->sOAprimary);
+      
+
       if(isset($attrs['RECORDS'])){
         $this->Records = $attrs['RECORDS']; 
 
@@ -385,22 +392,6 @@ class servdnseditZone extends plugin
       $message[] =sprintf(_("Please choose a valid reverse zone name."));
     }
 
-    if(!preg_match("/\.$/",$this->sOAprimary)){
-      $message[] = _("Primary dns server must end with '.' to be a valid entry.");
-    }
-
-    if(!preg_match("/\.$/",$this->sOAmail)){
-      $message[] = _("Your specified mail address must end with '.' to be a valid record.");
-    }
-
-    if(preg_match("/@/",$this->sOAmail)){
-      $message[] = _("Your mail address contains '@' replace this with '.' to enable GOsa to create a valid SOA record.");
-    }
-
-    if(preg_match("/@/",$this->sOAmail)){
-      $message[] = _("Your mail address contains '@' replace this with '.' to enable GOsa to create a valid SOA record.");
-    }
-
     if($this->zoneName != strtolower($this->zoneName)){
       $message[] = _("Only lowercase strings are allowed as zone name.");
     }
@@ -514,6 +505,10 @@ class servdnseditZone extends plugin
     $ret['InitialReverseZone']=  $this->InitialReverseZone;
     $ret['InitialzoneName']   =  $this->InitialzoneName;
 
+    $ret['sOAmail']            = preg_replace("/\@/",".",$this->sOAmail);
+    $ret['sOAmail']            = $ret['sOAmail'].".";
+    $ret['sOAprimary']         = $ret['sOAprimary'].".";
+
     return($ret);
   }