Now the data handling of the function 'events_page_details' id done connected to the node when necessary

This commit is contained in:
Alejandro Gallardo Escobar 2015-03-25 19:57:34 +01:00
parent 08d93c8b28
commit f462e38a7f
1 changed files with 10 additions and 15 deletions

View File

@ -1914,13 +1914,17 @@ function events_page_details ($event, $server = "") {
global $config; global $config;
// If server is provided, get the hash parameters // If server is provided, get the hash parameters
if (!empty($server)) { if (!empty($server) && defined("METACONSOLE")) {
$hashdata = metaconsole_get_server_hashdata($server); $hashdata = metaconsole_get_server_hashdata($server);
$hashstring = "&" . $hashstring = "&" .
"loginhash=auto&" . "loginhash=auto&" .
"loginhash_data=" . $hashdata . "&" . "loginhash_data=" . $hashdata . "&" .
"loginhash_user=" . str_rot13($config["id_user"]); "loginhash_user=" . str_rot13($config["id_user"]);
$serverstring = $server['server_url'] . "/"; $serverstring = $server['server_url'] . "/";
if (metaconsole_connect($server) !== NOERR) {
return ui_print_error_message(__('There was an error connecting to the node'), '', true);
}
} }
else { else {
$hashstring = ""; $hashstring = "";
@ -1951,14 +1955,7 @@ function events_page_details ($event, $server = "") {
} }
if ($event["id_agente"] != 0) { if ($event["id_agente"] != 0) {
if (!empty($server)) { $agent = db_get_row('tagente','id_agente',$event["id_agente"]);
$agent = agents_meta_get_agent(array('id_agent' => $event["id_agente"],
'id_server' => $server['id'],
'server_name' => $server['server_name']));
}
else {
$agent = db_get_row('tagente','id_agente',$event["id_agente"]);
}
} }
else { else {
$agent = array(); $agent = array();
@ -2007,12 +2004,7 @@ function events_page_details ($event, $server = "") {
} }
if ($event["id_agentmodule"] != 0) { if ($event["id_agentmodule"] != 0) {
if (!empty($server)) { $module = db_get_row_filter('tagente_modulo',array('id_agente_modulo' => $event["id_agentmodule"], 'delete_pending' => 0));
$module = meta_modules_get_agentmodule ($event["id_agentmodule"], $server['id']);
}
else {
$module = db_get_row_filter('tagente_modulo',array('id_agente_modulo' => $event["id_agentmodule"], 'delete_pending' => 0));
}
} }
else { else {
$module = array(); $module = array();
@ -2205,6 +2197,9 @@ function events_page_details ($event, $server = "") {
$details = '<div id="extended_event_details_page" class="extended_event_pages">'.html_print_table($table_details, true).'</div>'; $details = '<div id="extended_event_details_page" class="extended_event_pages">'.html_print_table($table_details, true).'</div>';
if (!empty($server) && defined("METACONSOLE"))
metaconsole_restore_db();
return $details; return $details;
} }