Code

Updated dns ACLs.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 22 Jul 2008 10:32:43 +0000 (10:32 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 22 Jul 2008 10:32:43 +0000 (10:32 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@11744 594d385d-05f5-0310-b6e9-bd551577e9d8

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

index 927b22895dfd4be339f05fd6f435d07808f82f3b..4eeff271971de65f1d85a5d49986f98b0453bc4b 100644 (file)
@@ -309,25 +309,27 @@ class servdnseditZone extends plugin
       }
     }
 
-    if((isset($_POST['AddMXRecord'])) && (!empty($_POST['StrMXRecord']))){
-      $this->mXRecords[] = array("type"=>"mXRecord","value"=>trim($_POST['StrMXRecord']));      
-    }
+    if($this->acl_is_writeable("mXRecord")){
+      if((isset($_POST['AddMXRecord'])) && (!empty($_POST['StrMXRecord']))){
+        $this->mXRecords[] = array("type"=>"mXRecord","value"=>trim($_POST['StrMXRecord']));      
+      }
 
-    /* Handle Post events */
-    $once = true;
-    foreach($_POST as $name => $value){
+      /* Handle Post events */
+      $once = true;
+      foreach($_POST as $name => $value){
 
-      /* Delete record if requested */
-      if((preg_match("/RemoveRecord_/",$name))&&($once)){
-        $once = false;
-        $id= preg_replace("/RemoveRecord_/","",$name);
-        unset($this->Records[$id]);
+        /* Delete record if requested */
+        if((preg_match("/RemoveRecord_/",$name))&&($once)){
+          $once = false;
+          $id= preg_replace("/RemoveRecord_/","",$name);
+          unset($this->Records[$id]);
+        }
       }
-    }
 
-    /* Add new Zonerecord */
-    if(isset($_POST['AddNewRecord'])){
-      $this->Records[] = array("type"=>"aRecord","value"=>"");
+      /* Add new Zonerecord */
+      if(isset($_POST['AddNewRecord'])){
+        $this->Records[] = array("type"=>"aRecord","value"=>"");
+      }
     }
 
     /* Fill in values */
@@ -374,31 +376,21 @@ class servdnseditZone extends plugin
   /* Save data to object */
   function save_object()
   {
-    //plugin::save_object();
-    foreach($this->attributes as $attr){
-
-      if($this->Zone_is_used && in_array($attr,array("ReverseZone","zoneName"))){
-        continue;
-      }
+    plugin::save_object();
 
-      if(isset($_POST[$attr])){
-        $this->$attr = $_POST[$attr];
+    if($this->acl_is_writeable("zoneRecords")){
+      foreach($this->Records as $id => $value){  
+        if(isset($_POST['RecordTypeSelectedFor_'.$id])){
+          $this->Records[$id]['type'] = $_POST['RecordTypeSelectedFor_'.$id];
+        }
+        if(isset($_POST['RecordValue_'.$id])){
+          $this->Records[$id]['value'] = $_POST['RecordValue_'.$id];
+        }
       }
     }
-
-    foreach($this->Records as $id => $value){  
-      if(isset($_POST['RecordTypeSelectedFor_'.$id])){
-        $this->Records[$id]['type'] = $_POST['RecordTypeSelectedFor_'.$id];
-      }
-      if(isset($_POST['RecordValue_'.$id])){
-        $this->Records[$id]['value'] = $_POST['RecordValue_'.$id];
-      }
+    if(isset($_POST['NetworkClass']) && !$this->Zone_is_used && $this->acl_is_writeable("NetworkClass")){
+      $this->NetworkClass = $_POST['NetworkClass'];
     }
-
-     if(isset($_POST['NetworkClass']) && !$this->Zone_is_used){
-       $this->NetworkClass = $_POST['NetworkClass'];
-     }
-
   }