From 2781b4ab34d0b8c30cfba28d6d4cb24be78bf34f Mon Sep 17 00:00:00 2001 From: Daniel Maya Date: Tue, 5 Jan 2021 11:42:34 +0100 Subject: [PATCH] Fixed task list groups --- .../godmode/wizards/DiscoveryTaskList.class.php | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/pandora_console/godmode/wizards/DiscoveryTaskList.class.php b/pandora_console/godmode/wizards/DiscoveryTaskList.class.php index a0a5fe549f..df81a7e8ff 100644 --- a/pandora_console/godmode/wizards/DiscoveryTaskList.class.php +++ b/pandora_console/godmode/wizards/DiscoveryTaskList.class.php @@ -379,7 +379,22 @@ class DiscoveryTaskList extends HTML include_once $config['homedir'].'/include/functions_servers.php'; include_once $config['homedir'].'/include/functions_network_profiles.php'; - $recon_tasks = db_get_all_rows_sql('SELECT * FROM trecon_task'); + if (users_is_admin()) { + $recon_tasks = db_get_all_rows_sql('SELECT * FROM trecon_task'); + } else { + $user_groups = implode( + ',', + array_keys(users_get_groups()) + ); + $recon_tasks = db_get_all_rows_sql( + sprintf( + 'SELECT * FROM trecon_task + WHERE id_group IN (%s)', + $user_groups + ) + ); + } + // Show network tasks for Recon Server. if ($recon_tasks === false) { $recon_tasks = [];