From 326d90f9851442ce1a18a042862cc745ee5bd504 Mon Sep 17 00:00:00 2001 From: juanmanuelr Date: Mon, 14 Jan 2013 09:51:44 +0000 Subject: [PATCH] 2013-01-14 Juan Manuel Ramon * include/functions_modules.php godmode/extensions.php godmode/agentes/configurar_agente.php godmode/servers/manage_recontask.php: Merged fixes from branches. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7444 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 7 +++++++ pandora_console/godmode/agentes/configurar_agente.php | 4 ++++ pandora_console/godmode/extensions.php | 2 +- pandora_console/godmode/servers/manage_recontask.php | 6 ++++++ pandora_console/include/functions_modules.php | 8 ++++++++ 5 files changed, 26 insertions(+), 1 deletion(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 3374b194de..da96a99f0e 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,10 @@ +2013-01-14 Juan Manuel Ramon + + * include/functions_modules.php + godmode/extensions.php + godmode/agentes/configurar_agente.php + godmode/servers/manage_recontask.php: Merged fixes from branches. + 2013-01-11 Ramon Novoa * godmode/setup/setup_netflow.php: Fixed a string. diff --git a/pandora_console/godmode/agentes/configurar_agente.php b/pandora_console/godmode/agentes/configurar_agente.php index 72b56673de..0df7ad5606 100644 --- a/pandora_console/godmode/agentes/configurar_agente.php +++ b/pandora_console/godmode/agentes/configurar_agente.php @@ -693,6 +693,10 @@ if ($update_module || $create_module) { $tcp_send = (string) get_parameter ('tcp_send'); $tcp_rcv = (string) get_parameter ('tcp_rcv'); $tcp_port = (int) get_parameter ('tcp_port'); + // Correction in order to not insert 0 as port + $is_port_empty = get_parameter ('tcp_port'); + if (empty($is_port_empty)) + $tcp_port = NULL; $configuration_data = (string) get_parameter ('configuration_data'); $old_configuration_data = (string) get_parameter ('old_configuration_data'); $new_configuration_data = ''; diff --git a/pandora_console/godmode/extensions.php b/pandora_console/godmode/extensions.php index 2e956c04ac..9b8fd90408 100644 --- a/pandora_console/godmode/extensions.php +++ b/pandora_console/godmode/extensions.php @@ -218,7 +218,7 @@ foreach ($extensions as $file => $extension) { $data[] = $config['extensions'][$file]['operation_menu']['version']; } else if ($config['extensions'][$file]['godmode_menu']) { $data[] = $config['extensions'][$file]['godmode_menu']['version']; - } else if ($config['extensions'][$file]['extension_ope_tab']) { + } else if (isset($config['extensions'][$file]['extension_ope_tab'])) { $data[] = $config['extensions'][$file]['extension_ope_tab']['version']; } else if ($config['extensions'][$file]['extension_god_tab']) { $data[] = $config['extensions'][$file]['extension_god_tab']['version']; diff --git a/pandora_console/godmode/servers/manage_recontask.php b/pandora_console/godmode/servers/manage_recontask.php index a08a3afb47..04f0cc4119 100644 --- a/pandora_console/godmode/servers/manage_recontask.php +++ b/pandora_console/godmode/servers/manage_recontask.php @@ -127,12 +127,15 @@ if (isset($_GET["update"])) { $where = array('id_rt' => $id); + $reason = ''; if ($name != "") { if (($id_recon_script == 'NULL') && preg_match("/[0-9]+.+[0-9]+.+[0-9]+.+[0-9]+\/+[0-9]/", $network)) $result = db_process_sql_update('trecon_task', $values, $where); elseif ($id_recon_script != 'NULL') $result = db_process_sql_update('trecon_task', $values, $where); else { + if (!preg_match("/[0-9]+.+[0-9]+.+[0-9]+.+[0-9]+\/+[0-9]/", $network)) + $reason = __('Incorrect format in Subnet field'); $result = false; } } @@ -144,6 +147,7 @@ if (isset($_GET["update"])) { } else { echo '

'.__('Error updating recon task').'

'; + echo $reason; } } @@ -185,6 +189,8 @@ if (isset($_GET["create"])) { $result = db_process_sql_insert('trecon_task', $values); } else { + if (!preg_match("/[0-9]+.+[0-9]+.+[0-9]+.+[0-9]+\/+[0-9]/", $network)) + $reason = __('Incorrect format in Subnet field'); $result = false; } } diff --git a/pandora_console/include/functions_modules.php b/pandora_console/include/functions_modules.php index 1027317b76..f7e4a73439 100644 --- a/pandora_console/include/functions_modules.php +++ b/pandora_console/include/functions_modules.php @@ -167,6 +167,14 @@ function modules_copy_agent_module_to_agent ($id_agent_module, $id_destiny_agent } } + // Copy module tags + $source_tags = tags_get_module_tags($id_agent_module); + + if ($source_tags == false) + $source_tags = array(); + + tags_insert_module_tag($id_new_module, $source_tags); + //Added the config data if necesary enterprise_include_once('include/functions_config_agents.php');