From 14b3ffa1b69f55476fe04fab5b1bf99decfd762f Mon Sep 17 00:00:00 2001 From: hickert Date: Tue, 29 Nov 2011 09:49:26 +0000 Subject: [PATCH] Applied patch Mike Gabriel, to enabled removal of dhcp host entries when host is removed. git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6@21086 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../systems/admin/systems/class_termDNS.inc | 23 +++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/gosa-plugins/systems/admin/systems/class_termDNS.inc b/gosa-plugins/systems/admin/systems/class_termDNS.inc index 23bfb4058..5fcdd76e0 100644 --- a/gosa-plugins/systems/admin/systems/class_termDNS.inc +++ b/gosa-plugins/systems/admin/systems/class_termDNS.inc @@ -471,9 +471,15 @@ class termDNS extends plugin function remove_from_parent() { + + $ldap = $this->config->get_ldap_link(); + + /************ + * DNS Handling + ************/ + if($this->DNS_is_account){ - $ldap = $this->config->get_ldap_link(); $tmp = array(); $this->dnsEntry['exists'] = false; @@ -489,6 +495,19 @@ class termDNS extends plugin } } } + + + /************ + * DHCP Handling + ************/ + + /* DHCP removed */ + if($this->dhcp_is_Account){ + $ldap->rmdir_recursive($this->dhcpHostEntry['dn']); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dhcpHostEntry['dn'], LDAP_DEL, get_class())); + } + } } @@ -786,7 +805,7 @@ class termDNS extends plugin ($this->dhcpHostEntry['dhcpStatements'] == "" || count($this->dhcpHostEntry['dhcpStatements']) == 0) ){ unset($this->dhcpHostEntry['dhcpStatements']); } - + /* DHCP removed */ if($this->initial_dhcp_is_Account && !$this->dhcp_is_Account){ $ldap->rmdir_recursive($this->dhcpHostEntry['dn']); -- 2.30.2