Code

Applied patch Mike Gabriel, to enabled removal of dhcp host entries when host is...
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 29 Nov 2011 09:49:26 +0000 (09:49 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 29 Nov 2011 09:49:26 +0000 (09:49 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6@21086 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/systems/admin/systems/class_termDNS.inc

index 23bfb40585810f3434b83f5a159e8c4aa0b56f56..5fcdd76e05a563f4344055ae917d5fc037614eb9 100644 (file)
@@ -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']);