Code

Updated groups acls
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 27 May 2008 13:40:30 +0000 (13:40 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 27 May 2008 13:40:30 +0000 (13:40 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@11045 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/plugins/admin/groups/class_divListGroup.inc
gosa-core/plugins/admin/groups/class_groupManagement.inc

index 6c3304f2b8a8088126ec0c1f94040b9f0d9dfc4a..7edccb3d3492db6a80300511fb8acce9c8f195b7 100644 (file)
@@ -210,8 +210,6 @@ class divListGroup extends MultiSelectWindow
     if(is_object($this->parent->CopyPasteHandler) && preg_match("/r/",$acl_all)){
       $s.= "..|<img src='images/lists/copy.png' alt='' border='0' class='center'>".
         "&nbsp;"._("Copy")."|"."multiple_copy_systems|\n";
-    }
-    if(is_object($this->parent->CopyPasteHandler) && preg_match("/(r.*d|d.*r)/",$acl_all)){ 
       $s.= "..|<img src='images/lists/cut.png' alt='' border='0' class='center'>".
         "&nbsp;"._("Cut")."|"."multiple_cut_systems|\n";
     }
index bcb71bd1a624236b73c6d8833bdedb25cadc5a4b..ea0aa64c7be7ba1a50b4296c3eb75c4785c396f1 100644 (file)
@@ -343,27 +343,40 @@ class groupManagement extends plugin
       $ids = $this->list_get_selected_items();
 
       if(count($ids)){
-
+        $disallowed = array();
         $this->dns = array();
         foreach($ids as $id){
-          $this->dns[$id] =  $this->grouplist[$id]['dn'];
+          $dn = $this->grouplist[$id]['dn'];
+          $acl = $this->ui->get_permissions($dn, "groups/group");
+          if(preg_match("/d/",$acl)){
+            $this->dns[$id] = $dn;
+          }else{
+            $disallowed[] = $dn;
+          }
         }
 
-        /* Check locks */
-        if ($user= get_multiple_locks($this->dns)){
-          return(gen_locked_message($user,$this->dns));
+        if(count($disallowed)){
+          msg_dialog::display(_("Permission"),msgPool::permDelete($disallowed),INFO_DIALOG);
         }
 
-        $dns_names = array();
-        foreach($this->dns as $dn){
-          $dns_names[] =@LDAP::fix($dn);
-        }
-        add_lock ($this->dns, $this->ui->dn);
+        if(count($this->dns)){
 
-        /* Lock the current entry, so nobody will edit it during deletion */
-        $smarty->assign("info", msgPool::deleteInfo($dns_names,_("group")));
-        $smarty->assign("multiple", true);
-        return($smarty->fetch(get_template_path('remove.tpl', TRUE)));
+          /* Check locks */
+          if ($user= get_multiple_locks($this->dns)){
+            return(gen_locked_message($user,$this->dns));
+          }
+
+          $dns_names = array();
+          foreach($this->dns as $dn){
+            $dns_names[] =@LDAP::fix($dn);
+          }
+          add_lock ($this->dns, $this->ui->dn);
+
+          /* Lock the current entry, so nobody will edit it during deletion */
+          $smarty->assign("info", msgPool::deleteInfo($dns_names,_("group")));
+          $smarty->assign("multiple", true);
+          return($smarty->fetch(get_template_path('remove.tpl', TRUE)));
+        }
       }
     }
 
@@ -410,7 +423,7 @@ class groupManagement extends plugin
        ********************/
 
       /* Remove lock */
-    if(isset($_POST['delete_multiple_user_cancel'])){
+    if(isset($_POST['delete_multiple_group_cance'])){
 
       /* Remove lock file after successfull deletion */
       $this->remove_lock();
@@ -712,13 +725,21 @@ class groupManagement extends plugin
       return("");
     }
 
+    $ui = get_userinfo();
+
     /* Add a single entry to queue */
     if($s_action == "cut" || $s_action == "copy"){
 
       /* Cleanup object queue */
       $this->CopyPasteHandler->cleanup_queue();
       $dn = $this->grouplist[$s_entry]['dn'];
-      $this->CopyPasteHandler->add_to_queue($dn,$s_action,"grouptabs","GROUPTABS","groups");
+      if($s_action == "copy" && preg_match("/r/",$ui->has_complete_category_acls($dn,"groups"))){
+        $this->CopyPasteHandler->add_to_queue($dn,$s_action,"grouptabs","GROUPTABS","groups");
+      }
+      if($s_action == "cut" && preg_match("/(r.*d|d.*r)/",$ui->has_complete_category_acls($dn,"groups"))){
+        $this->CopyPasteHandler->add_to_queue($dn,$s_action,"grouptabs","GROUPTABS","groups");
+      }
+
     }
 
 
@@ -732,10 +753,10 @@ class groupManagement extends plugin
       foreach($this->list_get_selected_items() as $id){
         $dn = $this->grouplist[$id]['dn'];
 
-        if($s_action == "copy_multiple"){
+        if($s_action == "copy_multiple" && preg_match("/r/",$ui->has_complete_category_acls($dn,"groups"))){
           $this->CopyPasteHandler->add_to_queue($dn,"copy","grouptabs","GROUPTABS","groups");
         }
-        if($s_action == "cut_multiple"){
+        if($s_action == "cut_multiple" && preg_match("/(r.*d|d.*r)/",$ui->has_complete_category_acls($dn,"groups"))){
           $this->CopyPasteHandler->add_to_queue($dn,"cut","grouptabs","GROUPTABS","groups");
         }
       }