Merge branch 'ent-6892-Discover-Task-List-no-hay-limitación-por-grupo' into 'develop'

Ent 6892 discover task list no hay limitación por grupo

See merge request artica/pandorafms!3756
This commit is contained in:
Daniel Rodriguez 2021-03-05 12:56:01 +00:00
commit b9f72a1ef9
1 changed files with 16 additions and 1 deletions

View File

@ -476,7 +476,22 @@ class DiscoveryTaskList extends HTML
include_once $config['homedir'].'/include/functions_servers.php';
include_once $config['homedir'].'/include/functions_network_profiles.php';
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 = [];