mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-31 01:35:36 +02:00
2013-04-23 Miguel de Dios <miguel.dedios@artica.es>
* operation/events/events_list.php, operation/events/events.php, include/functions_events.php: fixed PHP warnings. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8032 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
85413ab82b
commit
b7ecca62cb
@ -1,3 +1,8 @@
|
|||||||
|
2013-04-23 Miguel de Dios <miguel.dedios@artica.es>
|
||||||
|
|
||||||
|
* operation/events/events_list.php, operation/events/events.php,
|
||||||
|
include/functions_events.php: fixed PHP warnings.
|
||||||
|
|
||||||
2013-04-23 Miguel de Dios <miguel.dedios@artica.es>
|
2013-04-23 Miguel de Dios <miguel.dedios@artica.es>
|
||||||
|
|
||||||
* godmode/tag/tag.php: fixed the column for large list of emails,
|
* godmode/tag/tag.php: fixed the column for large list of emails,
|
||||||
|
@ -1689,9 +1689,10 @@ function events_page_responses ($event) {
|
|||||||
// If server_id > 0, is a metaconsole query
|
// If server_id > 0, is a metaconsole query
|
||||||
function events_get_response_target($event_id, $response_id, $server_id, $history = false) {
|
function events_get_response_target($event_id, $response_id, $server_id, $history = false) {
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
$event_response = db_get_row('tevent_response','id',$response_id);
|
$event_response = db_get_row('tevent_response','id',$response_id);
|
||||||
|
|
||||||
if($server_id > 0) {
|
if ($server_id > 0) {
|
||||||
$meta = true;
|
$meta = true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -1699,9 +1700,9 @@ function events_get_response_target($event_id, $response_id, $server_id, $histor
|
|||||||
}
|
}
|
||||||
|
|
||||||
$event_table = events_get_events_table($meta, $history);
|
$event_table = events_get_events_table($meta, $history);
|
||||||
|
|
||||||
$event = db_get_row($event_table,'id_evento', $event_id);
|
$event = db_get_row($event_table,'id_evento', $event_id);
|
||||||
|
|
||||||
$macros = array_keys(events_get_macros());
|
$macros = array_keys(events_get_macros());
|
||||||
|
|
||||||
$target = io_safe_output($event_response['target']);
|
$target = io_safe_output($event_response['target']);
|
||||||
@ -1737,9 +1738,10 @@ function events_get_response_target($event_id, $response_id, $server_id, $histor
|
|||||||
|
|
||||||
function events_page_custom_fields ($event) {
|
function events_page_custom_fields ($event) {
|
||||||
global $config;
|
global $config;
|
||||||
/////////
|
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
// Custom fields
|
// Custom fields
|
||||||
/////////
|
////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
$table->width = '100%';
|
$table->width = '100%';
|
||||||
$table->data = array ();
|
$table->data = array ();
|
||||||
@ -1786,14 +1788,14 @@ function events_page_custom_fields ($event) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$custom_fields = '<div id="extended_event_custom_fields_page" class="extended_event_pages">'.html_print_table($table, true).'</div>';
|
$custom_fields = '<div id="extended_event_custom_fields_page" class="extended_event_pages">'.html_print_table($table, true).'</div>';
|
||||||
|
|
||||||
return $custom_fields;
|
return $custom_fields;
|
||||||
}
|
}
|
||||||
|
|
||||||
function events_page_details ($event, $server = "") {
|
function events_page_details ($event, $server = "") {
|
||||||
global $img_sev;
|
global $img_sev;
|
||||||
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)) {
|
||||||
$hashdata = metaconsole_get_server_hashdata($server);
|
$hashdata = metaconsole_get_server_hashdata($server);
|
||||||
@ -1804,10 +1806,10 @@ function events_page_details ($event, $server = "") {
|
|||||||
$hashstring = "";
|
$hashstring = "";
|
||||||
$serverstring = "";
|
$serverstring = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
/////////
|
////////////////////////////////////////////////////////////////////
|
||||||
// Details
|
// Details
|
||||||
/////////
|
////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
$table_details->width = '100%';
|
$table_details->width = '100%';
|
||||||
$table_details->data = array ();
|
$table_details->data = array ();
|
||||||
@ -1816,7 +1818,7 @@ function events_page_details ($event, $server = "") {
|
|||||||
$table_details->style[1] = 'text-align: left;';
|
$table_details->style[1] = 'text-align: left;';
|
||||||
$table_details->class = "databox alternate";
|
$table_details->class = "databox alternate";
|
||||||
|
|
||||||
switch($event['event_type']) {
|
switch ($event['event_type']) {
|
||||||
case 'going_unknown':
|
case 'going_unknown':
|
||||||
case 'going_up_warning':
|
case 'going_up_warning':
|
||||||
case 'going_down_warning':
|
case 'going_down_warning':
|
||||||
@ -1832,7 +1834,7 @@ function events_page_details ($event, $server = "") {
|
|||||||
else {
|
else {
|
||||||
$agent = array();
|
$agent = array();
|
||||||
}
|
}
|
||||||
|
|
||||||
$data = array();
|
$data = array();
|
||||||
$data[0] = __('Agent details');
|
$data[0] = __('Agent details');
|
||||||
$data[1] = empty($agent) ? '<i>' . __('N/A') . '</i>' : '';
|
$data[1] = empty($agent) ? '<i>' . __('N/A') . '</i>' : '';
|
||||||
@ -1853,12 +1855,12 @@ function events_page_details ($event, $server = "") {
|
|||||||
$data[0] = '<div style="font-weight:normal; margin-left: 20px;">'.__('OS').'</div>';
|
$data[0] = '<div style="font-weight:normal; margin-left: 20px;">'.__('OS').'</div>';
|
||||||
$data[1] = ui_print_os_icon ($agent["id_os"], true, true).' ('.$agent["os_version"].')';
|
$data[1] = ui_print_os_icon ($agent["id_os"], true, true).' ('.$agent["os_version"].')';
|
||||||
$table_details->data[] = $data;
|
$table_details->data[] = $data;
|
||||||
|
|
||||||
$data = array();
|
$data = array();
|
||||||
$data[0] = '<div style="font-weight:normal; margin-left: 20px;">'.__('Last contact').'</div>';
|
$data[0] = '<div style="font-weight:normal; margin-left: 20px;">'.__('Last contact').'</div>';
|
||||||
$data[1] = $agent["ultimo_contacto"] == "1970-01-01 00:00:00" ? '<i>'.__('N/A').'</i>' : $agent["ultimo_contacto"];
|
$data[1] = $agent["ultimo_contacto"] == "1970-01-01 00:00:00" ? '<i>'.__('N/A').'</i>' : $agent["ultimo_contacto"];
|
||||||
$table_details->data[] = $data;
|
$table_details->data[] = $data;
|
||||||
|
|
||||||
$data = array();
|
$data = array();
|
||||||
$data[0] = '<div style="font-weight:normal; margin-left: 20px;">'.__('Last remote contact').'</div>';
|
$data[0] = '<div style="font-weight:normal; margin-left: 20px;">'.__('Last remote contact').'</div>';
|
||||||
$data[1] = $agent["ultimo_contacto_remoto"] == "1970-01-01 00:00:00" ? '<i>'.__('N/A').'</i>' : $agent["ultimo_contacto_remoto"];
|
$data[1] = $agent["ultimo_contacto_remoto"] == "1970-01-01 00:00:00" ? '<i>'.__('N/A').'</i>' : $agent["ultimo_contacto_remoto"];
|
||||||
@ -1876,31 +1878,32 @@ function events_page_details ($event, $server = "") {
|
|||||||
else {
|
else {
|
||||||
$module = array();
|
$module = array();
|
||||||
}
|
}
|
||||||
|
|
||||||
$data = array();
|
$data = array();
|
||||||
$data[0] = __('Module details');
|
$data[0] = __('Module details');
|
||||||
$data[1] = empty($module) ? '<i>' . __('N/A') . '</i>' : '';
|
$data[1] = empty($module) ? '<i>' . __('N/A') . '</i>' : '';
|
||||||
$table_details->data[] = $data;
|
$table_details->data[] = $data;
|
||||||
|
|
||||||
if (!empty($module)) {
|
if (!empty($module)) {
|
||||||
// Module name
|
// Module name
|
||||||
$data = array();
|
$data = array();
|
||||||
$data[0] = '<div style="font-weight:normal; margin-left: 20px;">'.__('Name').'</div>';
|
$data[0] = '<div style="font-weight:normal; margin-left: 20px;">'.__('Name').'</div>';
|
||||||
$data[1] = '<a href="'.$serverstring.'index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$event["id_agente"].'&tab=data'.$hashstring.'"><b>';
|
$data[1] = '<a href="' . $serverstring . 'index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$event["id_agente"].'&tab=data'.$hashstring.'"><b>';
|
||||||
$data[1] .= $module['nombre'];
|
$data[1] .= $module['nombre'];
|
||||||
$data[1] .= '</b></a>';
|
$data[1] .= '</b></a>';
|
||||||
$table_details->data[] = $data;
|
$table_details->data[] = $data;
|
||||||
|
|
||||||
// Module group
|
// Module group
|
||||||
$data = array();
|
$data = array();
|
||||||
$data[0] = '<div style="font-weight:normal; margin-left: 20px;">'.__('Module group').'</div>';
|
$data[0] = '<div style="font-weight:normal; margin-left: 20px;">' .
|
||||||
|
__('Module group') . '</div>';
|
||||||
$id_module_group = $module['id_module_group'];
|
$id_module_group = $module['id_module_group'];
|
||||||
if($id_module_group == 0) {
|
if ($id_module_group == 0) {
|
||||||
$data[1] = __('No assigned');
|
$data[1] = __('No assigned');
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$module_group = db_get_value('name', 'tmodule_group', 'id_mg', $id_module_group);
|
$module_group = db_get_value('name', 'tmodule_group', 'id_mg', $id_module_group);
|
||||||
$data[1] = '<a href="'.$serverstring.'index.php?sec=estado&sec2=operation/agentes/status_monitor&status=-1&modulegroup=' . $id_module_group . $hashstring.'">';
|
$data[1] = '<a href="'.$serverstring . 'index.php?sec=estado&sec2=operation/agentes/status_monitor&status=-1&modulegroup=' . $id_module_group . $hashstring.'">';
|
||||||
$data[1] .= $module_group;
|
$data[1] .= $module_group;
|
||||||
$data[1] .= '</a>';
|
$data[1] .= '</a>';
|
||||||
}
|
}
|
||||||
@ -1914,7 +1917,8 @@ function events_page_details ($event, $server = "") {
|
|||||||
}
|
}
|
||||||
$graph_type = return_graphtype ($module_module_type);
|
$graph_type = return_graphtype ($module_module_type);
|
||||||
|
|
||||||
$win_handle=dechex(crc32($module["id_agente_modulo"].$module["module_name"]));
|
$win_handle=dechex(crc32($module["id_agente_modulo"] .
|
||||||
|
$module["nombre"]));
|
||||||
|
|
||||||
$module_module_name = '';
|
$module_module_name = '';
|
||||||
if (isset($module["module_name"])) {
|
if (isset($module["module_name"])) {
|
||||||
|
@ -34,7 +34,7 @@ if (! check_acl ($config["id_user"], 0, "ER")) {
|
|||||||
|
|
||||||
// Set metaconsole mode
|
// Set metaconsole mode
|
||||||
$meta = false;
|
$meta = false;
|
||||||
if(enterprise_installed() && defined("METACONSOLE")) {
|
if (enterprise_installed() && defined("METACONSOLE")) {
|
||||||
$meta = true;
|
$meta = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -43,7 +43,7 @@ $history = (bool) get_parameter('history', 0);
|
|||||||
|
|
||||||
$readonly = false;
|
$readonly = false;
|
||||||
|
|
||||||
if(!$meta) {
|
if (!$meta) {
|
||||||
if (isset($config['event_replication']) &&
|
if (isset($config['event_replication']) &&
|
||||||
$config['event_replication'] == 1) {
|
$config['event_replication'] == 1) {
|
||||||
|
|
||||||
@ -226,7 +226,7 @@ $params = "search=" . rawurlencode(io_safe_input($search)) .
|
|||||||
"&severity=" . $severity .
|
"&severity=" . $severity .
|
||||||
"&status=" . $status .
|
"&status=" . $status .
|
||||||
"&ev_group=" . $ev_group .
|
"&ev_group=" . $ev_group .
|
||||||
"&refr=" . $config["refr"] .
|
"&refr=" . (int)get_parameter("refr", 0) .
|
||||||
"&id_agent=" . $id_agent .
|
"&id_agent=" . $id_agent .
|
||||||
"&pagination=" . $pagination .
|
"&pagination=" . $pagination .
|
||||||
"&group_rep=" . $group_rep .
|
"&group_rep=" . $group_rep .
|
||||||
@ -245,7 +245,7 @@ $params = "search=" . rawurlencode(io_safe_input($search)) .
|
|||||||
"&open_filter=" . $open_filter .
|
"&open_filter=" . $open_filter .
|
||||||
"&pure=" . $config["pure"];
|
"&pure=" . $config["pure"];
|
||||||
|
|
||||||
if($meta) {
|
if ($meta) {
|
||||||
$params .= "&text_agent=" . $text_agent;
|
$params .= "&text_agent=" . $text_agent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -327,7 +327,7 @@ $tabletags->rowclass[] = '';
|
|||||||
echo '<div id="event_control" style="display:none">';
|
echo '<div id="event_control" style="display:none">';
|
||||||
|
|
||||||
// Table for filter controls
|
// Table for filter controls
|
||||||
echo '<form id="form_filter" method="post" action="index.php?sec=eventos&sec2=operation/events/events&refr='.$config["refr"].'&pure='.$config["pure"].'&section=' . $section . '&history='.(int)$history.'">';
|
echo '<form id="form_filter" method="post" action="index.php?sec=eventos&sec2=operation/events/events&refr='. (int)get_parameter("refr", 0) .'&pure='.$config["pure"].'&section=' . $section . '&history='.(int)$history.'">';
|
||||||
|
|
||||||
// Hidden field with the loaded filter name
|
// Hidden field with the loaded filter name
|
||||||
html_print_input_hidden('id_name', $id_name);
|
html_print_input_hidden('id_name', $id_name);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user