From 6f71a01b0c4cabdb14e2953239b1330c12f5ec26 Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Tue, 7 Apr 2015 17:11:04 +0200 Subject: [PATCH] Fixed the separator (sometimes it is other) in the ajax call get_agent_modules_json_for_multiple_agents. --- pandora_console/include/ajax/module.php | 12 ++++++------ pandora_console/operation/agentes/ver_agente.php | 7 ++++++- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/pandora_console/include/ajax/module.php b/pandora_console/include/ajax/module.php index dc1b29dae1..2904992e12 100644 --- a/pandora_console/include/ajax/module.php +++ b/pandora_console/include/ajax/module.php @@ -66,8 +66,9 @@ if ($search_modules) { if ($get_module_detail) { - + // This script is included manually to be included after jquery and avoid error ui_include_time_picker(); + ui_require_jquery_file("ui.datepicker-" . get_user_language(), "include/javascript/i18n/"); $module_id = (int)get_parameter('id_module'); $period = get_parameter("period", SECONDS_1DAY); @@ -80,8 +81,8 @@ if ($get_module_detail) { $group = agents_get_agentmodule_group ($module_id); - $agentId = get_parameter("id_agent"); - $server_name = get_parameter('server_name'); + $agentId = (int) get_parameter("id_agent"); + $server_name = (string) get_parameter('server_name'); if (defined ('METACONSOLE')) { $server = metaconsole_get_connection ($server_name); @@ -128,7 +129,7 @@ if ($get_module_detail) { $formtable->data[0][3] = "". html_print_image ("images/refresh.png", true, array ("style" => 'vertical-align: middle;', "border" => "0" )) . ""; $formtable->rowspan[0][3] = 2; $formtable->cellstyle[0][3] = 'vertical-align: middle;'; - + $formtable->data[1][0] = html_print_radio_button_extended( "selection_mode", 'range','', $selection_mode, false, '', 'style="margin-right: 15px;"', true) . __("Specify time range"); @@ -285,9 +286,8 @@ if ($get_module_detail) { html_print_table($table); } - if (defined ('METACONSOLE')) { + if (defined ('METACONSOLE')) metaconsole_restore_db(); - } return; } diff --git a/pandora_console/operation/agentes/ver_agente.php b/pandora_console/operation/agentes/ver_agente.php index 17a3043c56..86980495b2 100644 --- a/pandora_console/operation/agentes/ver_agente.php +++ b/pandora_console/operation/agentes/ver_agente.php @@ -246,7 +246,12 @@ if (is_ajax ()) { foreach ($idAgents as $idA) { if (empty($metaconsole_server_name)) { - $row = explode ('|', $idA); + if (strstr($idA, "|@_@|")) { + $row = explode ('|@_@|', $idA); + } + else { + $row = explode ('|', $idA); + } $server_name = $row[0]; $id_agent = $row [1]; }