From: hickert Date: Wed, 28 May 2008 06:09:38 +0000 (+0000) Subject: Updated blocklist copy & paste acl checks X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=64824335990de3c94880663845dacbec930cfbde;p=gosa.git Updated blocklist copy & paste acl checks git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@11054 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-plugins/gofax/gofax/blocklists/class_blocklistManagement.inc b/gosa-plugins/gofax/gofax/blocklists/class_blocklistManagement.inc index 3712ff7b8..a4c3eddd1 100644 --- a/gosa-plugins/gofax/gofax/blocklists/class_blocklistManagement.inc +++ b/gosa-plugins/gofax/gofax/blocklists/class_blocklistManagement.inc @@ -212,24 +212,38 @@ class blocklist extends plugin $ids = $this->list_get_selected_items(); if(count($ids)){ - + $disallowed = array(); foreach($ids as $id){ - $this->dns[$id] = $this->blocklists[$id]['dn']; - } - if ($user= get_multiple_locks($this->dns)){ - return(gen_locked_message($user,$this->dns)); + $dn = $this->blocklists[$id]['dn']; + $acl = $this->ui->get_permissions($dn, "gofaxlist/blocklistGeneric"); + if(preg_match("/d/",$acl)){ + $this->dns[$id] = $dn; + }else{ + $disallowed[] = $dn; + } } - $dns_names = array(); - foreach($this->dns as $dn){ - $dns_names[]=@LDAP::fix( $dn); + if(count($disallowed)){ + msg_dialog::display(_("Permission"),msgPool::permDelete($disallowed),INFO_DIALOG); } - 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,_("blocklist"))); - $smarty->assign("multiple", true); - return($smarty->fetch(get_template_path('remove.tpl', TRUE))); + if(count($this->dns)){ + + 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,_("blocklist"))); + $smarty->assign("multiple", true); + return($smarty->fetch(get_template_path('remove.tpl', TRUE))); + } } } @@ -425,12 +439,19 @@ class blocklist 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->blocklists[$s_entry]['dn']; - $this->CopyPasteHandler->add_to_queue($dn,$s_action,"faxblocktabs","FAXBLOCKTABS","gofaxlist"); + if($s_action == "copy" && preg_match("/r/",$ui->has_complete_category_acls($dn,"gofaxlist"))){ + $this->CopyPasteHandler->add_to_queue($dn,$s_action,"faxblocktabs","FAXBLOCKTABS","gofaxlist"); + } + if($s_action == "cut" && preg_match("/(r.*d|d.*r)/",$ui->has_complete_category_acls($dn,"gofaxlist"))){ + $this->CopyPasteHandler->add_to_queue($dn,$s_action,"faxblocktabs","FAXBLOCKTABS","gofaxlist"); + } } /* Add entries to queue */ @@ -443,10 +464,10 @@ class blocklist extends plugin foreach($this->list_get_selected_items() as $id){ $dn = $this->blocklists[$id]['dn']; - if($s_action == "copy_multiple"){ + if($s_action == "copy_multiple" && preg_match("/r/",$ui->has_complete_category_acls($dn,"gofaxlist"))){ $this->CopyPasteHandler->add_to_queue($dn,"copy","faxblocktabs","FAXBLOCKTABS","gofaxlist"); } - if($s_action == "cut_multiple"){ + if($s_action == "cut_multiple" && preg_match("/(r.*d|d.*r)/",$ui->has_complete_category_acls($dn,"gofaxlist"))){ $this->CopyPasteHandler->add_to_queue($dn,"cut","faxblocktabs","FAXBLOCKTABS","gofaxlist"); } } diff --git a/gosa-plugins/gofax/gofax/blocklists/class_divListBlocklists.inc b/gosa-plugins/gofax/gofax/blocklists/class_divListBlocklists.inc index 904198dd1..4ba92520b 100644 --- a/gosa-plugins/gofax/gofax/blocklists/class_divListBlocklists.inc +++ b/gosa-plugins/gofax/gofax/blocklists/class_divListBlocklists.inc @@ -155,10 +155,8 @@ class divListBlocklist extends MultiSelectWindow $s.= "..|---|\n"; $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"; - } + $s.= "..|". + " "._("Cut")."|"."multiple_cut_systems|\n"; } /* Copy & paste icons */