From: hickert Date: Wed, 28 May 2008 06:15:38 +0000 (+0000) Subject: Updated conference acls X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=88f4a79a1fe9eaa36603367136e0b44f8202f081;p=gosa.git Updated conference acls git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@11056 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-plugins/gofon/gofon/conference/class_divListConferences.inc b/gosa-plugins/gofon/gofon/conference/class_divListConferences.inc index 0c10b8257..7bd2d7205 100644 --- a/gosa-plugins/gofon/gofon/conference/class_divListConferences.inc +++ b/gosa-plugins/gofon/gofon/conference/class_divListConferences.inc @@ -152,10 +152,8 @@ class divListConference 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 */ diff --git a/gosa-plugins/gofon/gofon/conference/class_phoneConferenceManagment.inc b/gosa-plugins/gofon/gofon/conference/class_phoneConferenceManagment.inc index 02c2f642b..dacf2a8bf 100644 --- a/gosa-plugins/gofon/gofon/conference/class_phoneConferenceManagment.inc +++ b/gosa-plugins/gofon/gofon/conference/class_phoneConferenceManagment.inc @@ -167,30 +167,43 @@ class phoneConferenceManagment extends plugin if ($s_action=="del_multiple"){ $ids = $this->list_get_selected_items(); + $this->dns = array(); if(count($ids)){ - - /* Collect dns */ + $disallowed = array(); foreach($ids as $id){ - $this->dns[$id] = $this->conferences[$id]['dn']; + $dn = $this->conferences[$id]['dn']; + $acl = $this->ui->get_permissions($dn, "gofonconference/conference"); + 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); } - /* Prepare entry list to be displayed */ - $dns_names = array(); - foreach($this->dns as $dn){ - $dns_names[] = @LDAP::fix($dn); - } + if(count($this->dns)){ - /* Lock the current entry, so nobody will edit it during deletion */ - add_lock ($this->dns, $this->ui->dn); + /* Check locks */ + if ($user= get_multiple_locks($this->dns)){ + return(gen_locked_message($user,$this->dns)); + } + + /* Prepare entry list to be displayed */ + $dns_names = array(); + foreach($this->dns as $dn){ + $dns_names[] = @LDAP::fix($dn); + } - $smarty->assign("info", msgPool::deleteInfo($dns_names,_("conference"))); - $smarty->assign("multiple", true); - return($smarty->fetch(get_template_path('remove.tpl', TRUE))); + /* Lock the current entry, so nobody will edit it during deletion */ + add_lock ($this->dns, $this->ui->dn); + + $smarty->assign("info", msgPool::deleteInfo($dns_names,_("conference"))); + $smarty->assign("multiple", true); + return($smarty->fetch(get_template_path('remove.tpl', TRUE))); + } } } @@ -465,13 +478,21 @@ class phoneConferenceManagment 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->conferences[$s_entry]['dn']; - $this->CopyPasteHandler->add_to_queue($dn,$s_action,"conferencetabs","CONFERENCETABS","gofonconference"); + + if($s_action == "copy" && preg_match("/r/",$ui->has_complete_category_acls($dn,"gofonconference"))){ + $this->CopyPasteHandler->add_to_queue($dn,$s_action,"conferencetabs","CONFERENCETABS","gofonconference"); + } + if($s_action == "cut" && preg_match("/(r.*d|d.*r)/",$ui->has_complete_category_acls($dn,"gofonconference"))){ + $this->CopyPasteHandler->add_to_queue($dn,$s_action,"conferencetabs","CONFERENCETABS","gofonconference"); + } } /* Add entries to queue */ @@ -484,10 +505,10 @@ class phoneConferenceManagment extends plugin foreach($this->list_get_selected_items() as $id){ $dn = $this->conferences[$id]['dn']; - if($s_action == "copy_multiple"){ + if($s_action == "copy_multiple" && preg_match("/r/",$ui->has_complete_category_acls($dn,"gofonconference"))){ $this->CopyPasteHandler->add_to_queue($dn,"copy","conferencetabs","CONFERENCETABS","gofonconference"); } - if($s_action == "cut_multiple"){ + if($s_action == "cut_multiple" && preg_match("/(r.*d|d.*r)/",$ui->has_complete_category_acls($dn,"gofonconference"))){ $this->CopyPasteHandler->add_to_queue($dn,"cut","conferencetabs","CONFERENCETABS","gofonconference"); } }