Code

Updated the dns plugin
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 8 Jul 2009 07:43:51 +0000 (07:43 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 8 Jul 2009 07:43:51 +0000 (07:43 +0000)
- Ensure that we do not create zoneNames twice...

git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@13910 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/dns/admin/systems/services/dns/class_servDNSeditZone.inc

index b61601c6e6b3035e864cf780bd6673bfcbe48db6..67f2c0df084550212475afe57aa91bfb50eef05b 100644 (file)
@@ -403,9 +403,15 @@ class servdnseditZone extends plugin
   {
     /* Call common method to give check the hook */
     $message= plugin::check();
-        
+    
     /* Check if zoneName is already in use */
     $usedZones = $this->getUsedZoneNames();
+    if($this->OldZoneName == "" && !empty($this->zoneName)){
+      $tmp = trim($this->zoneName,".").".";
+      if(isset($usedZones[$tmp])){
+        $message[] = msgPool::duplicated(_("Zone name"));
+      }
+    }
 
     if(empty($this->zoneName)){
       $message[] = msgPool::required(_("Zone name"));
@@ -464,7 +470,7 @@ class servdnseditZone extends plugin
       default : trigger_error("Invalid network class given '".$this->NetworkClass."'");
     }
     foreach($zones as $name => $data){
-      if($data['ReverseZone'] == $test){
+      if($data['ReverseZone'] == $test && $data['zoneName'] != $this->InitialzoneName){
         $message[] = msgPool::duplicated(_("Network address"));
       }
     }