diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 4a1e4c5cd3..e268ec6fb3 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,13 @@ +2013-02-18 Miguel de Dios + + * include/functions_modules.php, + operation/agentes/status_monitor.php, + operation/agentes/estado_ultimopaquete.php, + operation/agentes/estado_monitores.php, + operation/agentes/datos_agente.php, operation/search_modules.php: + fixed to show strings from for example Selenium Plugin that have + html tags. + 2013-02-18 Miguel de Dios * operation/search_modules.php, operation/agentes/ver_agente.php, diff --git a/pandora_console/include/functions_modules.php b/pandora_console/include/functions_modules.php index 54c988b1b0..172f929ef8 100644 --- a/pandora_console/include/functions_modules.php +++ b/pandora_console/include/functions_modules.php @@ -1399,7 +1399,7 @@ function modules_get_modulegroup_name ($modulegroup_id) { function modules_get_status($id_agent_module, $db_status, $data, &$status, &$title) { $status = STATUS_MODULE_WARNING; $title = ""; - + // This module is initialized ? (has real data) //$module_init = db_get_value ('utimestamp', 'tagente_estado', 'id_agente_modulo', $id_agent_module); if ($db_status == 4) { @@ -1423,13 +1423,16 @@ function modules_get_status($id_agent_module, $db_status, $data, &$status, &$tit $last_status = modules_get_agentmodule_last_status($id_agent_module); switch($last_status) { case 0: - $title = __('UNKNOWN')." - ".__('Last status')." ".__('NORMAL'); + $title = __('UNKNOWN') . " - " . __('Last status') . + " " . __('NORMAL'); break; case 1: - $title = __('UNKNOWN')." - ".__('Last status')." ".__('CRITICAL'); + $title = __('UNKNOWN') . " - " . __('Last status') . + " " . __('CRITICAL'); break; case 2: - $title = __('UNKNOWN')." - ".__('Last status')." ".__('WARNING'); + $title = __('UNKNOWN') . " - " . __('Last status') . + " " . __('WARNING'); break; } } @@ -1438,7 +1441,14 @@ function modules_get_status($id_agent_module, $db_status, $data, &$status, &$tit $title .= ": " . format_for_graph($data); } else { - $title .= ": " . substr(io_safe_output($data),0,42); + $text = io_safe_output($data); + + //Fixed the data from Selenium Plugin + if ($text != strip_tags($text)) { + $text = io_safe_input($text); + } + + $title .= ": " . substr($text ,0,42); } } diff --git a/pandora_console/operation/agentes/datos_agente.php b/pandora_console/operation/agentes/datos_agente.php index 8c8cb4345d..ca208446fe 100644 --- a/pandora_console/operation/agentes/datos_agente.php +++ b/pandora_console/operation/agentes/datos_agente.php @@ -273,7 +273,11 @@ foreach ($result as $row) { else { // Just a string of alphanumerical data... just do print - $data[$attr[1]] = $row[$attr[0]]; + //Fixed the data from Selenium Plugin + if ($row[$attr[0]] != strip_tags($row[$attr[0]])) + $data[$attr[1]] = io_safe_input($row[$attr[0]]); + else + $data[$attr[1]] = $row[$attr[0]]; } } diff --git a/pandora_console/operation/agentes/estado_monitores.php b/pandora_console/operation/agentes/estado_monitores.php index 30f685a177..add335c672 100644 --- a/pandora_console/operation/agentes/estado_monitores.php +++ b/pandora_console/operation/agentes/estado_monitores.php @@ -321,6 +321,7 @@ foreach ($modules as $module) { $module['datos'] = io_safe_input($module['datos']); } + $data = array (); if (($module["id_modulo"] != 1) && ($module["id_tipo_modulo"] != 100)) { if ($module["flag"] == 0) { @@ -405,7 +406,16 @@ foreach ($modules as $module) { } $data[4] = ui_print_string_substr ($module["descripcion"], 60, true, 8); - modules_get_status($module['id_agente_modulo'], $module['estado'], $module['datos'], $status, $title); + + if ($module["datos"] != strip_tags($module["datos"])) { + $module_value = io_safe_input($module["datos"]); + } + else { + $module_value = io_safe_output($module["datos"]); + } + + modules_get_status($module['id_agente_modulo'], $module['estado'], + $module_value, $status, $title); $data[5] = ui_print_status_image($status, $title, true); @@ -465,7 +475,7 @@ foreach ($modules as $module) { $handle = "snapshot"."_".$module["id_agente_modulo"]; $url = 'include/procesos.php?agente='.$module["id_agente_modulo"]; - $win_handle=dechex(crc32($handle)); + $win_handle = dechex(crc32($handle)); $link ="winopeng_var('operation/agentes/snapshot_view.php?id=".$module["id_agente_modulo"]."&refr=".$module["current_interval"]."&label=".$module["nombre"]."','".$win_handle."', 700,480)"; @@ -475,10 +485,17 @@ foreach ($modules as $module) { //Fixed the goliat sends the strings from web //without HTML entities if ($module['id_tipo_modulo'] == $id_type_web_content_string) { - $sub_string = substr($module["datos"], 0, 12); + $sub_string = substr($module_value, 0, 12); } else { - $sub_string = substr(io_safe_output($module["datos"]),0, 12); + //Fixed the data from Selenium Plugin + if ($module_value != strip_tags($module_value)) { + $module_value = io_safe_input($module_value); + $sub_string = substr($module_value, 0, 12); + } + else { + $sub_string = substr(io_safe_output($module_value),0, 12); + } } diff --git a/pandora_console/operation/agentes/estado_ultimopaquete.php b/pandora_console/operation/agentes/estado_ultimopaquete.php index 2d3d7d8138..a14816657b 100644 --- a/pandora_console/operation/agentes/estado_ultimopaquete.php +++ b/pandora_console/operation/agentes/estado_ultimopaquete.php @@ -517,7 +517,14 @@ foreach ($modules as $module) { $sub_string = substr($module["datos"], 0, 12); } else { - $sub_string = substr(io_safe_output($module["datos"]),0, 12); + //Fixed the data from Selenium Plugin + if ($module_value != strip_tags($module_value)) { + $module_value = io_safe_input($module_value); + $sub_string = substr($module_value,0, 12); + } + else { + $sub_string = substr(io_safe_output($module_value),0, 12); + } } if ($module_value == $sub_string) { diff --git a/pandora_console/operation/agentes/status_monitor.php b/pandora_console/operation/agentes/status_monitor.php index c4a0dbac3c..abbb0d7389 100644 --- a/pandora_console/operation/agentes/status_monitor.php +++ b/pandora_console/operation/agentes/status_monitor.php @@ -840,6 +840,11 @@ foreach ($result as $row) { $row['datos'] = io_safe_input($row['datos']); } + //Fixed the data from Selenium Plugin + if ($row['datos'] != strip_tags($row['datos'])) { + $row['datos'] = io_safe_input($row['datos']); + } + if ($rowPair) $table->rowclass[$iterator] = 'rowPair'; else @@ -1005,9 +1010,18 @@ foreach ($result as $row) { $sub_string = substr($row["datos"], 0, 12); } else { - $sub_string = substr(io_safe_output($row["datos"]),0, 12); + //Fixed the data from Selenium Plugin + if ($module_value != strip_tags($module_value)) { + $module_value = io_safe_input($module_value); + $sub_string = substr($row["datos"], 0, 12); + } + else { + $sub_string = substr(io_safe_output($row["datos"]),0, 12); + } } + + if ($module_value == $sub_string) { $salida = $module_value; } diff --git a/pandora_console/operation/search_modules.php b/pandora_console/operation/search_modules.php index 5fa542838c..2c82bf89b4 100644 --- a/pandora_console/operation/search_modules.php +++ b/pandora_console/operation/search_modules.php @@ -206,6 +206,11 @@ else { $module['datos'] = io_safe_input($module['datos']); } + //Fixed the data from Selenium Plugin + if ($module['datos'] != strip_tags($module['datos'])) { + $module['datos'] = io_safe_input($module['datos']); + } + $agentCell = '' . $module['agent_name'] . ''; @@ -305,10 +310,17 @@ else { //Fixed the goliat sends the strings from web //without HTML entities if ($module['id_tipo_modulo'] == $id_type_web_content_string) { - $sub_string = substr($module["datos"], 0, 12); + $sub_string = substr($module_value, 0, 12); } else { - $sub_string = substr(io_safe_output($module["datos"]),0, 12); + //Fixed the data from Selenium Plugin + if ($module_value != strip_tags($module_value)) { + $module_value = io_safe_input($module_value); + $sub_string = substr($module_value, 0, 12); + } + else { + $sub_string = substr(io_safe_output($module_value),0, 12); + } } if ($module_value == $sub_string) {