From 8b9051d44be4930773b78fc9655649fc6e13603a Mon Sep 17 00:00:00 2001 From: hickert Date: Fri, 15 Dec 2006 06:26:07 +0000 Subject: [PATCH] Fixed acls for deparmtment remove git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@5399 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../class_departmentManagement.inc | 30 ++++++++++++------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/plugins/admin/departments/class_departmentManagement.inc b/plugins/admin/departments/class_departmentManagement.inc index 6adc17b89..61b18f59f 100644 --- a/plugins/admin/departments/class_departmentManagement.inc +++ b/plugins/admin/departments/class_departmentManagement.inc @@ -147,15 +147,22 @@ class departmentManagement extends plugin if ($s_action =="del"){ $this->dn= $this->config->departments[trim($s_entry)]; - /* Check locking */ - if (($user= get_lock($this->dn)) != ""){ - $_SESSION['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))); - $display.= $smarty->fetch (get_template_path('remove.tpl', TRUE)); - return ($display); + /* 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['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))); + $display.= $smarty->fetch (get_template_path('remove.tpl', TRUE)); + return ($display); + } + }else{ + print_red (_("You have no permission to remove this department.")); } } @@ -168,7 +175,10 @@ class departmentManagement extends plugin * Finally delete department */ if (isset($_POST['delete_department_confirm'])){ - if($this->acl_is_removeable()){ + + /* check acls */ + $acl = $this->ui->get_permissions($this->dn,"department/department"); + if(preg_match("/d/",$acl)){ $this->remove_from_parent(); gosa_log ("Department object'".$this->dn."' has been removed"); } else { -- 2.30.2