Code

Updated remove of departments.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 26 Jun 2008 11:24:53 +0000 (11:24 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 26 Jun 2008 11:24:53 +0000 (11:24 +0000)
-Changed delete method from remove to rmdir_recursive.

git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@11455 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/plugins/admin/departments/class_departmentGeneric.inc
gosa-core/plugins/admin/departments/class_departmentManagement.inc

index 45b5a52bed9c68f7d674ab1e47e6a1c665b3a86e..8b04650e2df8779b61e3edaf18be38fc3da5a4d2 100644 (file)
@@ -203,7 +203,7 @@ class department extends plugin
        {
                $ldap= $this->config->get_ldap_link();
                $ldap->cd ($this->dn);
-               $ldap->recursive_remove();
+               $ldap->rmdir_recursive($this->dn);
     new log("remove","department/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
     if (!$ldap->success()){
       msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_DEL, get_class()));
index 713b37c21e1ffe5614f868d093b178af84c1a230..b2ef6df435f42b8bf386aa42c624fe4d565079a1 100644 (file)
@@ -185,8 +185,13 @@ class departmentManagement extends plugin
       Delete MULTIPLE entries requested, display confirm dialog
      ********************/
 
-    if ($s_action=="del_multiple"){
-      $ids = $this->list_get_selected_items();
+    if ($s_action=="del_multiple" || $s_action == "del"){
+
+      if($s_action == "del"){
+        $ids = array($s_entry);
+      }else{
+        $ids = $this->list_get_selected_items();
+      }
 
       if(count($ids)){
         $this->dns = array();
@@ -254,56 +259,6 @@ class departmentManagement extends plugin
     }
 
 
-    /***************
-      Delete entry 
-     ***************/
-
-    /* Delete Entry if Posted action (s_action) == del 
-     * The entry which will be deleted is defined in $s_entry
-     */
-    if ($s_action =="del"){
-      $this->dn= $this->config->departments[trim($s_entry)];
-
-      /* check acls */
-      $acl = $this->ui->get_permissions($this->dn,"department/department");
-      if(preg_match("/d/",$acl)){
-
-        /* Check locking */
-        if (($user= get_lock($this->dn)) != ""){
-          session::set('dn',$this->dn);
-          return(gen_locked_message($user, $this->dn));
-        } else {
-          add_lock ($this->dn, $this->ui->dn);
-          $smarty->assign("info", sprintf(_("You're about to delete the whole LDAP subtree placed under '%s'."), @LDAP::fix($this->dn)));
-          $smarty->assign("multiple", false);
-          $display.= $smarty->fetch (get_template_path('remove.tpl', TRUE));
-          return ($display);
-        }
-      }else{
-        msg_dialog::display(_("Permission error"), msgPool::permDelete(), WARNING_DIALOG);
-      }
-    }
-
-
-    /***************
-      Delete department confirmed  
-     ***************/
-
-    /* If department deletion is accepted ...
-     * Finally delete department 
-     */
-    if (isset($_POST['delete_department_confirm'])){
-
-      /* check acls */
-      $acl = $this->ui->get_permissions($this->dn,"department/department");
-      if(preg_match("/d/",$acl)){
-        $this->remove_from_parent();
-      } else {
-        msg_dialog::display(_("Permission error"), msgPool::permDelete(), WARNING_DIALOG);
-      }
-    }
-
-
     /***************
       Handle tagging/recursive move (Return output for an iframe)
      ***************/