From 43627a71383481ddf2699ed576447b4de3e8e0bb Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 21 Jun 2006 05:49:06 +0000 Subject: [PATCH] Fixed DNS removement git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3839 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/admin/systems/class_servDNS.inc | 18 +++++++++++------- plugins/admin/systems/class_termDNS.inc | 2 +- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/plugins/admin/systems/class_servDNS.inc b/plugins/admin/systems/class_servDNS.inc index b290bd14b..e532daba3 100644 --- a/plugins/admin/systems/class_servDNS.inc +++ b/plugins/admin/systems/class_servDNS.inc @@ -227,9 +227,10 @@ class servdns extends plugin $str .=" ... "; } print_red(sprintf(_("Can't delete the selected zone, because it is still in use by these entry/entries '%s'"),trim($str))); - + return(false); }else{ unset($this->Zones[$id]); + return(true); } } @@ -254,13 +255,15 @@ class servdns extends plugin function remove_from_parent() { if($this->initially_was_account){ - $ldap = $this->config->get_ldap_link(); - $ldap->ls("(&(objectClass=dNSZone)(zoneName=*)(relativeDomainName=@))",$this->orig_dn,array("relativeDomainName","zoneName")); - while($attr = $ldap->fetch()){ - $ldap->cd($attr['dn']); - $ldap->rmdir_recursive($attr['dn']); + $bool = true; + foreach($this->Zones as $key => $zone){ + $bool= $bool & $this->RemoveZone($key); + } + + if($bool){ + $this->save(); } - show_ldap_error($ldap->get_error(), _("Removing DNS service failed")); + return($bool); } } @@ -322,6 +325,7 @@ class servdns extends plugin { if($value == "none") return; if(!$this->initially_was_account) return; + if(empty($this->StatusFlag)) return; $ldap = $this->config->get_ldap_link(); $ldap->cd($this->dn); $ldap->cat($this->dn,array("objectClass")); diff --git a/plugins/admin/systems/class_termDNS.inc b/plugins/admin/systems/class_termDNS.inc index e5e9c6fdf..143cbd81b 100644 --- a/plugins/admin/systems/class_termDNS.inc +++ b/plugins/admin/systems/class_termDNS.inc @@ -56,7 +56,7 @@ class termDNS extends plugin /* Hide all dns specific code, if dns is not available */ $DNSenabled = false; - foreach($this->config->data['TABS']['SERVTABS'] as $tab){ + foreach($this->config->data['TABS']['SERVERSERVICE'] as $tab){ if(preg_match("/^servdns$/",$tab['CLASS'])){ $this->DNSenabled = true; } -- 2.30.2