From 4d70cdd24a12898b98473a10fcef388e6480d3be Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Mon, 23 Mar 2015 14:12:19 +0100 Subject: [PATCH 1/2] Fixed the view of list event filters with a user is setted strict_acl. #2017 --- pandora_console/godmode/events/event_filter.php | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/pandora_console/godmode/events/event_filter.php b/pandora_console/godmode/events/event_filter.php index ad3c544c9e..fc04fbecef 100644 --- a/pandora_console/godmode/events/event_filter.php +++ b/pandora_console/godmode/events/event_filter.php @@ -74,11 +74,23 @@ if ($multiple_delete) { __('Not deleted. Error deleting data')); } +$strict_acl = db_get_value('strict_acl', 'tusuario', 'id_user', $config['id_user']); + $own_info = get_user_info ($config['id_user']); // Get group list that user has access -$groups_user = users_get_groups ($config['id_user'], "EW", users_can_manage_group_all(), true); +if ($strict_acl) { + $groups_user = users_get_strict_mode_groups($config['id_user'], + users_can_manage_group_all()); +} +else { + $groups_user = users_get_groups ($config['id_user'], "EW", + users_can_manage_group_all(), true); +} -$sql = "SELECT * FROM tevent_filter WHERE id_group_filter IN (".implode(',', array_keys ($groups_user)).")"; +$sql = " + SELECT * + FROM tevent_filter + WHERE id_group_filter IN (".implode(',', array_keys ($groups_user)).")"; $filters = db_get_all_rows_sql($sql); if ($filters === false) From 118b980f4eef6611178d6d20310a3123edc17418 Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Mon, 23 Mar 2015 14:17:06 +0100 Subject: [PATCH 2/2] Fixed the view of list event filters with a user is setted strict_acl. #2017 --- pandora_console/include/functions_events.php | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/pandora_console/include/functions_events.php b/pandora_console/include/functions_events.php index 6a0b141eac..df0677d324 100644 --- a/pandora_console/include/functions_events.php +++ b/pandora_console/include/functions_events.php @@ -1580,14 +1580,27 @@ function events_get_event_filter ($id_filter, $filter = false, $fields = false) * @param boolean If event filters are used for manage/view operations (non admin users can see group ALL for manage) # Fix * @return array A event filter matching id and filter or false. */ -function events_get_event_filter_select($manage = true){ +function events_get_event_filter_select($manage = true) { global $config; - $user_groups = users_get_groups ($config['id_user'], "EW", $manage, true); + $strict_acl = db_get_value('strict_acl', 'tusuario', 'id_user', $config['id_user']); + + if ($strict_acl) { + $user_groups = users_get_strict_mode_groups($config['id_user'], + users_can_manage_group_all()); + } + else { + $user_groups = users_get_groups ($config['id_user'], "EW", + users_can_manage_group_all(), true); + } + if(empty($user_groups)) { return array(); } - $sql = "SELECT id_filter, id_name FROM tevent_filter WHERE id_group IN (".implode(',', array_keys ($user_groups)).")"; + $sql = " + SELECT id_filter, id_name + FROM tevent_filter + WHERE id_group IN (" . implode(',', array_keys ($user_groups)) . ")"; $event_filters = db_get_all_rows_sql($sql);