Code

Fixed acls for deparmtment remove
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 15 Dec 2006 06:26:07 +0000 (06:26 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 15 Dec 2006 06:26:07 +0000 (06:26 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@5399 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/departments/class_departmentManagement.inc

index 6adc17b8971000bdda399eb49f5ea684ac3f1655..61b18f59f39104ba54cbb35db0e55f01ab7d6645 100644 (file)
@@ -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 {