2013-02-18 Miguel de Dios <miguel.dedios@artica.es>

* 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.




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7671 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2013-02-18 16:15:31 +00:00
parent 57065e9944
commit 87358525d4
7 changed files with 88 additions and 14 deletions

View File

@ -1,3 +1,13 @@
2013-02-18 Miguel de Dios <miguel.dedios@artica.es>
* 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 <miguel.dedios@artica.es>
* operation/search_modules.php, operation/agentes/ver_agente.php,

View File

@ -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);
}
}

View File

@ -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]];
}
}

View File

@ -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);
}
}

View File

@ -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) {

View File

@ -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;
}

View File

@ -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 = '<a href="index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=' . $module['id_agente'] . '">' .
$module['agent_name'] . '</a>';
@ -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) {