Code

Allow remove of dns extension
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 21 Jun 2006 04:04:22 +0000 (04:04 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 21 Jun 2006 04:04:22 +0000 (04:04 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3836 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/systems/class_servDNS.inc

index 155966473306d485bf01ae25fd62d5d0b3ddf073..b290bd14bbd28efc0ffb2e3fe4b4a672d4851171 100644 (file)
@@ -253,18 +253,15 @@ class servdns extends plugin
    */
   function remove_from_parent()
   {
-    if(!$this->initially_was_account){
-      return;
-    }
-    print_red("Can't remove dns yet. returning without remove.");
-    return;
-    $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($attr['dn']);
+    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']);
+      }
+      show_ldap_error($ldap->get_error(), _("Removing DNS service failed"));
     }
-    show_ldap_error($ldap->get_error(), _("Removing DNS service failed"));
   }