From 7be4103ca13a780ba02c88eff4dac5dbe8308a23 Mon Sep 17 00:00:00 2001 From: hickert Date: Thu, 10 Apr 2008 10:13:41 +0000 Subject: [PATCH] Updated network settings -Added graphical buttons git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10314 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../systems/admin/systems/class_termDNS.inc | 26 ++++++++++--------- .../systems/admin/systems/network.tpl | 4 +-- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/gosa-plugins/systems/admin/systems/class_termDNS.inc b/gosa-plugins/systems/admin/systems/class_termDNS.inc index 8a9d47998..06cb3ada7 100644 --- a/gosa-plugins/systems/admin/systems/class_termDNS.inc +++ b/gosa-plugins/systems/admin/systems/class_termDNS.inc @@ -257,20 +257,22 @@ class termDNS extends plugin **********/ /* Add a new one */ - if(isset($_POST['additionalHostNumbers_add'])){ - if(!is_array($this->additionalHostNumbers)){ - $this->additionalHostNumbers=array(); + foreach($_POST as $name => $value){ + if(preg_match("/^additionalHostNumbers_add/",$name)){ + $this->additionalHostNumbers[] = ""; + break; } - $this->additionalHostNumbers[] = ""; + + /* Delete given entry */ + if(preg_match("/^additionalHostNumbers_del_/",$name)){ + $id = preg_replace("/^^additionalHostNumbers_del_([0-9]*)_.*/","\\1",$name); + if(isset($this->additionalHostNumbers[$id])){ + unset($this->additionalHostNumbers[$id]); + $this->additionalHostNumbers = array_values($this->additionalHostNumbers); + } + break; + } } - - /* Delete given entry */ - foreach($this->additionalHostNumbers as $id => $value){ - if(isset($_POST['additionalHostNumbers_del_'.$id])){ - unset($this->additionalHostNumbers[$id]); - $this->additionalHostNumbers = array_values($this->additionalHostNumbers); - } - } $smarty->assign("additionalHostNumbers",$this->additionalHostNumbers); $smarty->assign("staticAddress", ""); diff --git a/gosa-plugins/systems/admin/systems/network.tpl b/gosa-plugins/systems/admin/systems/network.tpl index f1f309dc0..e63735237 100644 --- a/gosa-plugins/systems/admin/systems/network.tpl +++ b/gosa-plugins/systems/admin/systems/network.tpl @@ -14,9 +14,9 @@ {foreach from=$additionalHostNumbers item=item key=key}
- + {/foreach} - + {render acl=$ipHostNumberACL} {if $DNS_is_account == true} -- 2.30.2