From 47a0acf1d38f41bc5f6d1e5b09fd070427e01210 Mon Sep 17 00:00:00 2001 From: hickert Date: Thu, 8 May 2008 10:06:01 +0000 Subject: [PATCH] Udpated dns stuff. -If a host is removed, its dns entry will be removed too. git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@10845 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/admin/systems/class_termDNS.inc | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/plugins/admin/systems/class_termDNS.inc b/plugins/admin/systems/class_termDNS.inc index 252d99062..10677515e 100644 --- a/plugins/admin/systems/class_termDNS.inc +++ b/plugins/admin/systems/class_termDNS.inc @@ -343,20 +343,25 @@ 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("Record:".$ldap->get_error(), _("Removing terminal from DNS object failed")); - } - */ + if($this->DNSinitially_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); + show_ldap_error("Record:".$ldap->get_error(), _("Removing terminal from DNS object failed")); + } + } } + /* Save data to object */ function save_object() { -- 2.30.2