From 43032c68ff4b1257df3214adcbd2e7922a277470 Mon Sep 17 00:00:00 2001 From: hickert Date: Fri, 12 Jan 2007 04:12:26 +0000 Subject: [PATCH] Updated acls for terminalGeneric and network dns stuff git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@5542 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/admin/systems/class_termDNS.inc | 15 +++++++-------- plugins/admin/systems/class_terminalGeneric.inc | 13 ++++++++----- plugins/admin/systems/network.tpl | 15 ++++++++------- 3 files changed, 23 insertions(+), 20 deletions(-) diff --git a/plugins/admin/systems/class_termDNS.inc b/plugins/admin/systems/class_termDNS.inc index a62eaaeda..4b2cd52b9 100644 --- a/plugins/admin/systems/class_termDNS.inc +++ b/plugins/admin/systems/class_termDNS.inc @@ -153,6 +153,7 @@ class termDNS extends plugin /* Assign smarty all non DNs attributes */ foreach($this->attributes as $attr){ $smarty->assign($attr,$this->$attr); + $smarty->assign($attr."ACL",chkacl($this->acl,$attr)); } $smarty->assign("staticAddress","*"); @@ -191,14 +192,18 @@ class termDNS extends plugin /* Assign smarty all non DNs attributes */ foreach($this->attributes as $attr){ $smarty->assign($attr,$this->$attr); + $smarty->assign($attr."ACL",chkacl($this->acl,$attr)); } /* Assign smarty all DNS attributes */ foreach($this->DNSattributes as $attr){ $smarty->assign($attr,$this->dnsEntry[$attr]); + $smarty->assign($attr."ACL",chkacl($this->acl,$attr)); } /* Assign all needed vars */ + $smarty->assign("DNSaccountACL",chkacl($this->acl,"termDNS")); + $smarty->assign("DNSAccount",$this->DNS_is_account); $smarty->assign("Zones",$this->Zones); $smarty->assign("ZoneKeys",($this->Zones)); @@ -236,15 +241,8 @@ class termDNS extends plugin /* Save all posted vars */ plugin::save_object(); - /* Ge all non dns attributes (IP/MAC)*/ - foreach($this->attributes as $attr){ - if(isset($_POST[$attr])){ - $this->$attr = $_POST[$attr]; - } - } - /* Get dns attributes */ - if(($this->DNSenabled) && (isset($_POST['network_tpl_posted']))){ + if(($this->DNSenabled) && (isset($_POST['network_tpl_posted'])) && chkacl($this->acl,"termDNS") == ""){ /* Check for posted record changes */ if(is_array($this->dnsEntry['RECORDS'])){ @@ -424,6 +422,7 @@ class termDNS extends plugin /* Add || Update new DNS entries */ + print_a($tmp); foreach($tmp['add'] as $dn => $attrs){ $ldap->cd($dn); $ldap->cat($dn, array('dn')); diff --git a/plugins/admin/systems/class_terminalGeneric.inc b/plugins/admin/systems/class_terminalGeneric.inc index 7a12d4ef9..cb446b879 100644 --- a/plugins/admin/systems/class_terminalGeneric.inc +++ b/plugins/admin/systems/class_terminalGeneric.inc @@ -131,13 +131,14 @@ class termgeneric extends plugin /* Call parent execute */ plugin::execute(); + $this->netConfigDNS->acl = $this->acl; + /* Do we need to flip is_account state? */ if (isset($_POST['modify_state'])){ $this->is_account= !$this->is_account; } - if (isset($_POST['action'])){ - + if (isset($_POST['action']) && chkacl($this->acl,"FAIstate") ==""){ if($this->fai_activated && $this->dn != "new"){ /* Set FAIstate */ @@ -212,7 +213,7 @@ class termgeneric extends plugin /* Base select dialog */ $once = true; foreach($_POST as $name => $value){ - if(preg_match("/^chooseBase/",$name) && $once){ + if(preg_match("/^chooseBase/",$name) && $once && chkacl($this->acl,"base") == ""){ $once = false; $this->dialog = new baseSelectDialog($this->config); $this->dialog->setCurrentBase($this->base); @@ -242,12 +243,12 @@ class termgeneric extends plugin } /* Add new ntp Server to our list */ - if((isset($_POST['addNtpServer'])) && (isset($_POST['gotoNtpServers']))){ + if((isset($_POST['addNtpServer'])) && (isset($_POST['gotoNtpServers'])) && chkacl($this->acl,"gotoNtpServer")== ""){ $this->gotoNtpServer[$_POST['gotoNtpServers']] = $_POST['gotoNtpServers']; } /* Delete selected NtpServer for list of used servers */ - if((isset($_POST['delNtpServer'])) && (isset($_POST['gotoNtpServerSelected']))){ + if((isset($_POST['delNtpServer'])) && (isset($_POST['gotoNtpServerSelected'])) && chkacl($this->acl,"gotoNtpServer")== ""){ foreach($_POST['gotoNtpServerSelected'] as $name){ unset($this->gotoNtpServer[$name]); } @@ -317,6 +318,7 @@ class termgeneric extends plugin function remove_from_parent() { + $this->netConfigDNS->acl = $this->acl; $ldap= $this->config->get_ldap_link(); $ldap->cd($this->dn); $ldap->cat($this->dn, array('dn')); @@ -428,6 +430,7 @@ class termgeneric extends plugin /* Save to LDAP */ function save() { + $this->netConfigDNS->acl = $this->acl; /* Move object if requested */ if( $this->orig_dn != 'new' && $this->dn != $this->orig_dn){ diff --git a/plugins/admin/systems/network.tpl b/plugins/admin/systems/network.tpl index dcb3d4521..f3b68830c 100644 --- a/plugins/admin/systems/network.tpl +++ b/plugins/admin/systems/network.tpl @@ -7,23 +7,24 @@ - + - + {if $autonet==true} - + {/if}
{$staticAddress}
 
{if $DNS_is_account==true} - {/if} {t}Enable DNS for this device{/t} - + {if $DNSAccount == true}
{else} @@ -49,14 +50,14 @@ - {html_options values=$ZoneKeys output=$Zones selected=$zoneName} {t}TTL{/t} - + -- 2.30.2