From 4a42f1a345f5264d6daa1a0515d5c56e58881701 Mon Sep 17 00:00:00 2001 From: hickert Date: Tue, 27 May 2008 13:40:30 +0000 Subject: [PATCH] Updated groups acls git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@11045 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../admin/groups/class_divListGroup.inc | 2 - .../admin/groups/class_groupManagement.inc | 57 +++++++++++++------ 2 files changed, 39 insertions(+), 20 deletions(-) diff --git a/gosa-core/plugins/admin/groups/class_divListGroup.inc b/gosa-core/plugins/admin/groups/class_divListGroup.inc index 6c3304f2b..7edccb3d3 100644 --- a/gosa-core/plugins/admin/groups/class_divListGroup.inc +++ b/gosa-core/plugins/admin/groups/class_divListGroup.inc @@ -210,8 +210,6 @@ class divListGroup extends MultiSelectWindow if(is_object($this->parent->CopyPasteHandler) && preg_match("/r/",$acl_all)){ $s.= "..|". " "._("Copy")."|"."multiple_copy_systems|\n"; - } - if(is_object($this->parent->CopyPasteHandler) && preg_match("/(r.*d|d.*r)/",$acl_all)){ $s.= "..|". " "._("Cut")."|"."multiple_cut_systems|\n"; } diff --git a/gosa-core/plugins/admin/groups/class_groupManagement.inc b/gosa-core/plugins/admin/groups/class_groupManagement.inc index bcb71bd1a..ea0aa64c7 100644 --- a/gosa-core/plugins/admin/groups/class_groupManagement.inc +++ b/gosa-core/plugins/admin/groups/class_groupManagement.inc @@ -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"); } } -- 2.30.2