From 581d5e9c5f9140ae19cfae7d959ff8fe39c9638b Mon Sep 17 00:00:00 2001 From: m-lopez-f Date: Mon, 23 Mar 2015 14:48:27 +0100 Subject: [PATCH] Fixed list of data in report when user have strict_acl, tiquet: #2014 --- pandora_console/godmode/reporting/reporting_builder.php | 2 +- pandora_console/include/functions_reports.php | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/pandora_console/godmode/reporting/reporting_builder.php b/pandora_console/godmode/reporting/reporting_builder.php index 3e429d9793..23337e8496 100644 --- a/pandora_console/godmode/reporting/reporting_builder.php +++ b/pandora_console/godmode/reporting/reporting_builder.php @@ -451,7 +451,7 @@ switch ($action) { $reports = reports_get_reports ($filter, array ('name', 'id_report', 'description', 'private', - 'id_user', 'id_group', 'non_interactive'), $return_all_group, 'RR', $group); + 'id_user', 'id_group', 'non_interactive'), $return_all_group, 'RR', $group, $strict_user); $table->width = '0px'; if (sizeof ($reports)) { diff --git a/pandora_console/include/functions_reports.php b/pandora_console/include/functions_reports.php index 62b1c924c5..6cf27fc0af 100644 --- a/pandora_console/include/functions_reports.php +++ b/pandora_console/include/functions_reports.php @@ -82,7 +82,7 @@ function reports_get_report ($id_report, $filter = false, $fields = false) { * * @return array An array with all the reports the user can view. */ -function reports_get_reports ($filter = false, $fields = false, $returnAllGroup = true, $privileges = 'RR', $group = false) { +function reports_get_reports ($filter = false, $fields = false, $returnAllGroup = true, $privileges = 'RR', $group = false, $strict_user) { global $config; if (! is_array ($filter)) @@ -110,6 +110,8 @@ function reports_get_reports ($filter = false, $fields = false, $returnAllGroup else { //Recheck in all reports if the user have permissions to see each report. $groups = users_get_groups ($config['id_user'], $privileges, $returnAllGroup); + if ($strict_user) + $groups = users_get_strict_mode_groups ($config['id_user'], $returnAllGroup) } foreach ($all_reports as $report) {