From c451dd4495c7c520e2fa50ceda774ba5bbbd38d2 Mon Sep 17 00:00:00 2001 From: hickert Date: Thu, 30 Nov 2006 10:54:19 +0000 Subject: [PATCH] Reactivated remove_from parent for dns entries git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@5268 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/admin/systems/class_termDNS.inc | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/plugins/admin/systems/class_termDNS.inc b/plugins/admin/systems/class_termDNS.inc index f73fe741f..0e5263634 100644 --- a/plugins/admin/systems/class_termDNS.inc +++ b/plugins/admin/systems/class_termDNS.inc @@ -234,20 +234,26 @@ class termDNS extends plugin return($display); } + function remove_from_parent() { - /* - $ldap = $this->config->get_ldap_link(); - $ldap->cd($this->orig_dn); - $ldap->search("(&(objectClass=dNSZone)(zoneName=*)(!(relativeDomainName=@)))",array("relativeDomainName","zoneName")); - while($attr = $ldap->fetch()){ - $ldap->cd($attr['dn']); - $ldap->rmDir($attr['dn']); - show_ldap_error($ldap->get_error(), sprintf(_("Removing of terminal/dns acoount with dn '%s' failed."),$this->dn)); + if($this->initially_was_account){ + + $ldap = $this->config->get_ldap_link(); + + $tmp = array(); + $this->dnsEntry['exists'] = false; + $tmp = getDNSHostEntriesDiff($this->config,$this->OrigCn,$this->dnsEntry,$this->cn); + + /* Delete dns */ + foreach($tmp['del'] as $dn => $del){ + $ldap->cd($dn); + $ldap->rmdir_recursive($dn); + } } - */ } + /* Save data to object */ function save_object() { -- 2.30.2