From 3b06988082e42a279d2acf14fc60ed93ec03a509 Mon Sep 17 00:00:00 2001 From: Alejandro Gallardo Escobar Date: Wed, 25 Mar 2015 19:19:20 +0100 Subject: [PATCH] Fixed an ACL error on the 'tags_check_acl' and 'tags_check_acl_events' functions --- pandora_console/include/functions_tags.php | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/pandora_console/include/functions_tags.php b/pandora_console/include/functions_tags.php index 450f616cfe..a2a6b87171 100644 --- a/pandora_console/include/functions_tags.php +++ b/pandora_console/include/functions_tags.php @@ -1030,8 +1030,14 @@ function tags_check_acl($id_user, $id_group, $access, $tags = array(), $flag_id_ } // If there are not tags restrictions or tags passed, check the group access - if ((empty($acls) || empty($tags)) && check_acl($id_user, $id_group, $access)) { - return true; + if (empty($acls) || empty($tags)) { + if (!is_array($id_group)) + $group_id_array = array($id_group); + + foreach ($id_group as $group) { + if (check_acl($id_user, $group, $access)) + return true; + } } # Fix: If user profile has more than one group, due to ACL propagation then id_group can be an array @@ -1128,8 +1134,14 @@ function tags_check_acl_event($id_user, $id_group, $access, $tags = array(),$p = } // If there are not tags restrictions or tags passed, check the group access - if ((empty($acls) || empty($tags)) && check_acl($id_user, $id_group, $access)) { - return true; + if (empty($acls) || empty($tags)) { + if (!is_array($id_group)) + $group_id_array = array($id_group); + + foreach ($id_group as $group) { + if (check_acl($id_user, $group, $access)) + return true; + } } # Fix: If user profile has more than one group, due to ACL propagation then id_group can be an array