From 4ee89b5b3e5a92ac56efa8d8da36d9d9c2ed6817 Mon Sep 17 00:00:00 2001 From: "alejandro.campos@artica.es" Date: Wed, 21 Dec 2022 13:39:03 +0100 Subject: [PATCH] fixed count query for admin user --- .../include/lib/Dashboard/Manager.php | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/pandora_console/include/lib/Dashboard/Manager.php b/pandora_console/include/lib/Dashboard/Manager.php index a83c982d2a..f22aa7a4f0 100644 --- a/pandora_console/include/lib/Dashboard/Manager.php +++ b/pandora_console/include/lib/Dashboard/Manager.php @@ -695,7 +695,7 @@ class Manager implements PublicLogin // Check ACl. if (\is_user_admin($config['id_user']) !== true) { - // User no admin see dashboards of him groups and profile 'AR'. + // Non-admin user can see dashboards of his groups and 'AR' profile. $group_list = \users_get_groups( $config['id_user'], 'RR', @@ -802,7 +802,7 @@ class Manager implements PublicLogin global $config; if (is_user_admin($config['id_user']) !== false) { - // User no admin see dashboards of him groups and profile 'AR'. + // Non-admin user can see dashboards of his groups and 'AR' profile. $group_list = \users_get_groups( $config['id_user'], 'RR', @@ -820,18 +820,11 @@ class Manager implements PublicLogin $sql_dashboard = sprintf( "SELECT COUNT(*) FROM tdashboard - WHERE (id_group IN (%s) AND id_user = '') OR - id_user = '%s'", - $string_groups, - $config['id_user'] + WHERE (id_group IN (%s))", + $string_groups ); } else { - $sql_dashboard = sprintf( - "SELECT COUNT(*) - FROM tdashboard - WHERE id_group = 0 AND id_user = '%s'", - $config['id_user'] - ); + $sql_dashboard = 'SELECT COUNT(*) FROM tdashboard WHERE id_group = 0'; } } else { $sql_dashboard = 'SELECT COUNT(*) FROM tdashboard';