From a9e080ed31ea224bfa67f83e549ea161b6d62e57 Mon Sep 17 00:00:00 2001 From: slerena Date: Fri, 21 Aug 2009 13:32:07 +0000 Subject: [PATCH] 2009-08-20 Sancho Lerena * godmode/agentes/configurar_agente.php: Fixed bug with agent address edition (return 0 when no address was supplied). * godmode/modules/manage_network_components.php: Fixed typo. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1871 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 8 ++++++++ .../godmode/agentes/configurar_agente.php | 19 ++++++++++--------- .../modules/manage_network_components.php | 2 +- 3 files changed, 19 insertions(+), 10 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 5178cdb91f..8da29f0585 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,10 @@ +2009-08-20 Sancho Lerena + + * godmode/agentes/configurar_agente.php: Fixed bug with agent address + edition (return 0 when no address was supplied). + + * godmode/modules/manage_network_components.php: Fixed typo. + 2009-08-19 Sancho Lerena * pandoradb.sql: A missing table was necessary to be added to allow recon @@ -36,6 +43,7 @@ * include/functions_config.php: add to save the attachment_store config value. + 2009-08-18 Miguel de Dios * godmode/reporting/reporting_builder.php: add filter parameter in ajax that diff --git a/pandora_console/godmode/agentes/configurar_agente.php b/pandora_console/godmode/agentes/configurar_agente.php index 524d8ce6de..c444f0a7e6 100644 --- a/pandora_console/godmode/agentes/configurar_agente.php +++ b/pandora_console/godmode/agentes/configurar_agente.php @@ -49,7 +49,7 @@ $campo_3 = ""; $maximo = 0; $minimo = 0; $nombre_agente = ""; -$direccion_agente = get_parameter ('direccion'); +$direccion_agente = get_parameter ('direccion', ''); $intervalo = 300; $id_server = ""; $max_alerts = 0; @@ -107,18 +107,18 @@ $create_agent = (bool) get_parameter ('create_agent'); // Create agent if ($create_agent) { - $nombre_agente = (string) get_parameter_post ("agente"); - $direccion_agente = (string) get_parameter_post ("direccion"); + $nombre_agente = (string) get_parameter_post ("agente",''); + $direccion_agente = (string) get_parameter_post ("direccion",''); $grupo = (int) get_parameter_post ("grupo"); $intervalo = (string) get_parameter_post ("intervalo", 300); - $comentarios = (string) get_parameter_post ("comentarios"); + $comentarios = (string) get_parameter_post ("comentarios", ''); $modo = (int) get_parameter_post ("modo"); - $id_parent = (string) get_parameter_post ("id_parent"); + $id_parent = (string) get_parameter_post ("id_parent",''); $id_parent = (int) get_agent_id ($id_parent); $server_name = (string) get_parameter_post ("server_name"); $id_os = (int) get_parameter_post ("id_os"); $disabled = (int) get_parameter_post ("disabled"); - $custom_id = (string) get_parameter_post ("custom_id"); + $custom_id = (string) get_parameter_post ("custom_id",''); // Check if agent exists (BUG WC-50518-2) if ($nombre_agente == "") { @@ -259,14 +259,15 @@ if (isset( $_GET["fix_module"])) { if (isset($_POST["update_agent"])) { // if modified some agent paramenter $id_agente = (int) get_parameter_post ("id_agente"); $nombre_agente = (string) get_parameter_post ("agente", ""); - $direccion_agente = (string) get_parameter_post ("direccion", ""); - $address_list = (string) get_parameter_post ("address_list", ""); + $direccion_agente = (string) get_parameter_post ("direccion", ''); + $address_list = (string) get_parameter_post ("address_list", ''); if ($address_list != $direccion_agente && $direccion_agente == get_agent_address ($id_agente) && $address_list != get_agent_address ($id_agente)) { //If we selected another IP in the drop down list to be 'primary': // a) field is not the same as selectbox // b) field has not changed from current IP // c) selectbox is not the current IP - $direccion_agente = $address_list; + if ($address_list != 0) + $direccion_agente = $address_list; } $grupo = (int) get_parameter_post ("grupo", 0); $intervalo = (int) get_parameter_post ("intervalo", 300); diff --git a/pandora_console/godmode/modules/manage_network_components.php b/pandora_console/godmode/modules/manage_network_components.php index 61c54ac198..808a257544 100644 --- a/pandora_console/godmode/modules/manage_network_components.php +++ b/pandora_console/godmode/modules/manage_network_components.php @@ -213,7 +213,7 @@ $filter = array (); if ($search_id_group) $filter['id_group'] = $search_id_group; if ($search_string != '') - $filter[] = '(name LIKE "%'.$search_string.'%" OR description LIKE "%'.$search_string.'%" OR tcp_send LIKE "%'.$search_string.'%" OR tcp_rcv LIKE "%'.$search_stringg.'%")'; + $filter[] = '(name LIKE "%'.$search_string.'%" OR description LIKE "%'.$search_string.'%" OR tcp_send LIKE "%'.$search_string.'%" OR tcp_rcv LIKE "%'.$search_string.'%")'; $total_components = get_network_components (false, $filter, 'COUNT(*) AS total'); $total_components = $total_components[0]['total'];