From: hickert Date: Thu, 26 Jun 2008 11:24:53 +0000 (+0000) Subject: Updated remove of departments. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=31fb1331d2cdf43087f295c0b65fa09708c7a254;p=gosa.git Updated remove of departments. -Changed delete method from remove to rmdir_recursive. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@11455 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-core/plugins/admin/departments/class_departmentGeneric.inc b/gosa-core/plugins/admin/departments/class_departmentGeneric.inc index 45b5a52be..8b04650e2 100644 --- a/gosa-core/plugins/admin/departments/class_departmentGeneric.inc +++ b/gosa-core/plugins/admin/departments/class_departmentGeneric.inc @@ -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())); diff --git a/gosa-core/plugins/admin/departments/class_departmentManagement.inc b/gosa-core/plugins/admin/departments/class_departmentManagement.inc index 713b37c21..b2ef6df43 100644 --- a/gosa-core/plugins/admin/departments/class_departmentManagement.inc +++ b/gosa-core/plugins/admin/departments/class_departmentManagement.inc @@ -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) ***************/