From c5ce28963bbbb39a4ab8e5e1fdf0489d270feaca Mon Sep 17 00:00:00 2001 From: alexhigh Date: Mon, 16 Jun 2014 17:22:56 +0000 Subject: [PATCH] 2014-06-16 Alejandro Gallardo * godmode/massive/massive_copy_modules.php: Error fixes. * include/functions_agents.php: Fixed some returns on the function "agents_process_manage_config". git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@10203 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 7 ++++ .../godmode/massive/massive_copy_modules.php | 33 +++++++++++-------- pandora_console/include/functions_agents.php | 7 +++- 3 files changed, 32 insertions(+), 15 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 03453c6134..da8b236b7c 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,10 @@ +2014-06-16 Alejandro Gallardo + + * godmode/massive/massive_copy_modules.php: Error fixes. + + * include/functions_agents.php: Fixed some returns on the + function "agents_process_manage_config". + 2014-06-16 Miguel de Dios * include/functions_networkmap.php: fixed into the function diff --git a/pandora_console/godmode/massive/massive_copy_modules.php b/pandora_console/godmode/massive/massive_copy_modules.php index 4b3131793b..ed878af1d3 100644 --- a/pandora_console/godmode/massive/massive_copy_modules.php +++ b/pandora_console/godmode/massive/massive_copy_modules.php @@ -109,6 +109,16 @@ $modules = array (); if ($source_id_agent) $modules = agents_get_modules ($source_id_agent, 'nombre'); +$agent_alerts = array (); +if ($source_id_agent) + $agent_alerts = agents_get_alerts_simple ($source_id_agent); +$alerts = array (); +foreach ($agent_alerts as $alert) { + $name = alerts_get_alert_template_name ($alert['id_alert_template']); + $name .= ' ('.$modules[$alert['id_agent_module']].')'; + $alerts[$alert['id']] = $name; +} + $table->data['operations'][0] = __('Operations'); $table->data['operations'][1] = ''; $table->data['operations'][1] .= html_print_checkbox ('copy_modules', 1, true, true); @@ -130,16 +140,6 @@ $table->data[1][1] .= ''.__('No modules for this agent').''; $table->data[1][1] .= ''; $table->data[2][0] = __('Alerts'); - -$agent_alerts = array (); -if ($source_id_agent) - $agent_alerts = agents_get_alerts_simple ($source_id_agent); -$alerts = array (); -foreach ($agent_alerts as $alert) { - $name = alerts_get_alert_template_name ($alert['id_alert_template']); - $name .= ' ('.$modules[$alert['id_agent_module']].')'; - $alerts[$alert['id']] = $name; -} $table->data[2][1] = ''; $table->data[2][1] .= html_print_select ($alerts, 'target_alerts[]', 0, false, '', '', true, true); @@ -159,7 +159,6 @@ html_print_table ($table); echo ''; - /* Destiny selection */ $table->id = 'destiny_table'; $table->data = array (); @@ -187,9 +186,15 @@ $table->data[2][0] = __('Agent'); $table->data[2][0] .= ''; -$agents = ( $destiny_id_group ? - agents_get_group_agents ($destiny_id_group, false, "none") : - agents_get_group_agents (array_keys (users_get_groups ($config["id_user"], "AW", false))) ); + +$agents = array(); +if ($source_id_agent) { + $agents = ( $destiny_id_group ? + agents_get_group_agents ($destiny_id_group, false, "none") : + agents_get_group_agents (array_keys (users_get_groups ($config["id_user"], "AW", false))) ); + unset($agents[$source_id_agent]); +} + $table->data[2][1] = html_print_select ($agents, 'destiny_id_agent[]', 0, false, '', '', true, true); echo '