diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 9852ee04f7..2bd19bfdc5 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,12 @@ +2013-05-01 Miguel de Dios + + * godmode/agentes/agent_manager.php: improved the source code style. + + * godmode/agentes/configurar_agente.php: fixed the agents address + with white spaces in the both sides. + + Fixes: #2171 + 2013-05-01 Miguel de Dios * extensions/system_info.php, extensions/agents_modules.php, diff --git a/pandora_console/godmode/agentes/agent_manager.php b/pandora_console/godmode/agentes/agent_manager.php index 0afec4922a..b155e767af 100644 --- a/pandora_console/godmode/agentes/agent_manager.php +++ b/pandora_console/godmode/agentes/agent_manager.php @@ -96,7 +96,7 @@ enterprise_include ('godmode/agentes/agent_manager.php'); require_once ('include/functions_servers.php'); require_once ('include/functions_gis.php'); require_once($config['homedir'] . "/include/functions_agents.php"); -require_once ($config['homedir'].'/include/functions_users.php'); +require_once ($config['homedir'] . '/include/functions_users.php'); ui_require_javascript_file('openlayers.pandora'); diff --git a/pandora_console/godmode/agentes/configurar_agente.php b/pandora_console/godmode/agentes/configurar_agente.php index 3dde6e635c..5713e492b1 100644 --- a/pandora_console/godmode/agentes/configurar_agente.php +++ b/pandora_console/godmode/agentes/configurar_agente.php @@ -74,6 +74,8 @@ $maximo = 0; $minimo = 0; $nombre_agente = ""; $direccion_agente = get_parameter('direccion', ''); +$direccion_agente = trim(io_safe_output($direccion_agente)); +$direccion_agente = io_safe_input($direccion_agente); $intervalo = SECONDS_5MINUTES; $ff_interval = 0; $quiet_module = 0; @@ -145,6 +147,8 @@ $create_agent = (bool)get_parameter('create_agent'); if ($create_agent) { $nombre_agente = (string) get_parameter_post("agente",''); $direccion_agente = (string) get_parameter_post("direccion",''); + $direccion_agente = trim(io_safe_output($direccion_agente)); + $direccion_agente = io_safe_input($direccion_agente); $grupo = (int) get_parameter_post ("grupo"); $intervalo = (string) get_parameter_post ("intervalo", SECONDS_5MINUTES); $comentarios = (string) get_parameter_post ("comentarios", ''); @@ -261,7 +265,7 @@ if ($id_agente) { . html_print_image ("images/gm_modules.png", true, array ("title" =>__('Modules'))) . ''; - if($tab == 'module') + if ($tab == 'module') $moduletab['active'] = true; else $moduletab['active'] = false; @@ -520,6 +524,8 @@ if ($update_agent) { // if modified some agent paramenter $id_agente = (int) get_parameter_post ("id_agente"); $nombre_agente = str_replace('`','‘',(string) get_parameter_post ("agente", "")); $direccion_agente = (string) get_parameter_post ("direccion", ''); + $direccion_agente = trim(io_safe_output($direccion_agente)); + $direccion_agente = io_safe_input($direccion_agente); $address_list = (string) get_parameter_post ("address_list", ''); if ($address_list != $direccion_agente && $direccion_agente == agents_get_address ($id_agente) && $address_list != agents_get_address ($id_agente)) { //If we selected another IP in the drop down list to be 'primary':