From 6cb9b06cea84f8c88333f9943381ef5530e6d1fb Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Mon, 6 Apr 2020 13:42:39 +0200 Subject: [PATCH] minor fix, license limits while reapplying queue --- .../wizards/DiscoveryTaskList.class.php | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/pandora_console/godmode/wizards/DiscoveryTaskList.class.php b/pandora_console/godmode/wizards/DiscoveryTaskList.class.php index f41eada844..379ac3dae5 100644 --- a/pandora_console/godmode/wizards/DiscoveryTaskList.class.php +++ b/pandora_console/godmode/wizards/DiscoveryTaskList.class.php @@ -1343,9 +1343,21 @@ class DiscoveryTaskList extends HTML $ids = array_reduce( $selection, function ($carry, $item) use (&$n_agents) { - if (explode('-', $item['id'])[1] === null) { - // String is agent-module. - $n_agents++; + // String is agent-module. + $fields = explode('-', $item['id']); + $agent_name = $fields[0]; + $module_name = $fields[1]; + if ($module_name === null) { + // Do not count if already created. + if (db_get_value( + 'id_agente', + 'tagente', + 'nombre', + io_safe_input($agent_name) + ) === false + ) { + $n_agents++; + } } $carry[] = $item['id'];