Code

Udpated traling dot handling
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 27 Jun 2007 11:55:26 +0000 (11:55 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 27 Jun 2007 11:55:26 +0000 (11:55 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@6722 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/systems/class_servDNSeditZone.inc

index 454a3c21fa244dcfda2932f85740f59a8bf000d7..e81cf6923dbf28b2d72cb4ab8f5fbc57e2be9f0d 100644 (file)
@@ -74,7 +74,7 @@ class servdnseditZone extends plugin
       $this->sOAmail            = preg_replace("/\./","@",$this->sOAmail,1);
       $this->sOAmail            = preg_replace("/\.$/","",$this->sOAmail);
       $this->sOAprimary         = preg_replace("/\.$/","",$this->sOAprimary);
-      
+      $this->zoneName           = preg_replace("/\.$/","",$this->zoneName);
 
       if(isset($attrs['RECORDS'])){
         $this->Records = $attrs['RECORDS']; 
@@ -436,7 +436,7 @@ class servdnseditZone extends plugin
     if(!is_ip($addr)){
       $message[] = _("The given network address is not a valid, please specify a valid IP address.");
     }
-  
     /* Check if given address matches selected network class */
     switch($this->NetworkClass){
       case 'A': { 
@@ -512,8 +512,12 @@ class servdnseditZone extends plugin
     $ret['InitialzoneName']   =  $this->InitialzoneName;
 
     $ret['sOAmail']            = preg_replace("/\@/",".",$this->sOAmail);
-    $ret['sOAmail']            = $ret['sOAmail'].".";
-    $ret['sOAprimary']         = $ret['sOAprimary'].".";
+
+    foreach(array("sOAprimary","zoneName","sOAmail") as $attr){
+      if(!preg_match("/\.$/",$ret[$attr])){
+        $ret[$attr] = $ret[$attr].".";
+      }
+    }
 
     return($ret);
   }