From: hickert Date: Tue, 22 Jul 2008 10:32:43 +0000 (+0000) Subject: Updated dns ACLs. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=643d086861b3563cbc3e52f5761d9d7f44eebdcd;p=gosa.git Updated dns ACLs. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@11744 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-plugins/dns/admin/systems/services/dns/class_servDNSeditZone.inc b/gosa-plugins/dns/admin/systems/services/dns/class_servDNSeditZone.inc index 927b22895..4eeff2719 100644 --- a/gosa-plugins/dns/admin/systems/services/dns/class_servDNSeditZone.inc +++ b/gosa-plugins/dns/admin/systems/services/dns/class_servDNSeditZone.inc @@ -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']; - } - }