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:
mdtrooper 2013-04-23 11:22:06 +00:00
parent 7a74b6515e
commit 5e1e067e76
4 changed files with 35 additions and 26 deletions

View File

@ -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>
* godmode/tag/tag.php: fixed the column for large list of emails,

View File

@ -1689,9 +1689,10 @@ function events_page_responses ($event) {
// If server_id > 0, is a metaconsole query
function events_get_response_target($event_id, $response_id, $server_id, $history = false) {
global $config;
$event_response = db_get_row('tevent_response','id',$response_id);
if($server_id > 0) {
if ($server_id > 0) {
$meta = true;
}
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 = db_get_row($event_table,'id_evento', $event_id);
$macros = array_keys(events_get_macros());
$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) {
global $config;
/////////
////////////////////////////////////////////////////////////////////
// Custom fields
/////////
////////////////////////////////////////////////////////////////////
$table->width = '100%';
$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>';
return $custom_fields;
}
function events_page_details ($event, $server = "") {
global $img_sev;
global $config;
// If server is provided, get the hash parameters
if (!empty($server)) {
$hashdata = metaconsole_get_server_hashdata($server);
@ -1804,10 +1806,10 @@ function events_page_details ($event, $server = "") {
$hashstring = "";
$serverstring = "";
}
/////////
////////////////////////////////////////////////////////////////////
// Details
/////////
////////////////////////////////////////////////////////////////////
$table_details->width = '100%';
$table_details->data = array ();
@ -1816,7 +1818,7 @@ function events_page_details ($event, $server = "") {
$table_details->style[1] = 'text-align: left;';
$table_details->class = "databox alternate";
switch($event['event_type']) {
switch ($event['event_type']) {
case 'going_unknown':
case 'going_up_warning':
case 'going_down_warning':
@ -1832,7 +1834,7 @@ function events_page_details ($event, $server = "") {
else {
$agent = array();
}
$data = array();
$data[0] = __('Agent details');
$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[1] = ui_print_os_icon ($agent["id_os"], true, true).' ('.$agent["os_version"].')';
$table_details->data[] = $data;
$data = array();
$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"];
$table_details->data[] = $data;
$data = array();
$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"];
@ -1876,31 +1878,32 @@ function events_page_details ($event, $server = "") {
else {
$module = array();
}
$data = array();
$data[0] = __('Module details');
$data[1] = empty($module) ? '<i>' . __('N/A') . '</i>' : '';
$table_details->data[] = $data;
if (!empty($module)) {
// Module name
$data = array();
$data[0] = '<div style="font-weight:normal; margin-left: 20px;">'.__('Name').'</div>';
$data[1] = '<a href="'.$serverstring.'index.php?sec=estado&amp;sec2=operation/agentes/ver_agente&amp;id_agente='.$event["id_agente"].'&amp;tab=data'.$hashstring.'"><b>';
$data[1] = '<a href="' . $serverstring . 'index.php?sec=estado&amp;sec2=operation/agentes/ver_agente&amp;id_agente='.$event["id_agente"].'&amp;tab=data'.$hashstring.'"><b>';
$data[1] .= $module['nombre'];
$data[1] .= '</b></a>';
$table_details->data[] = $data;
// Module group
$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'];
if($id_module_group == 0) {
if ($id_module_group == 0) {
$data[1] = __('No assigned');
}
else {
$module_group = db_get_value('name', 'tmodule_group', 'id_mg', $id_module_group);
$data[1] = '<a href="'.$serverstring.'index.php?sec=estado&amp;sec2=operation/agentes/status_monitor&amp;status=-1&amp;modulegroup=' . $id_module_group . $hashstring.'">';
$data[1] = '<a href="'.$serverstring . 'index.php?sec=estado&amp;sec2=operation/agentes/status_monitor&amp;status=-1&amp;modulegroup=' . $id_module_group . $hashstring.'">';
$data[1] .= $module_group;
$data[1] .= '</a>';
}
@ -1914,7 +1917,8 @@ function events_page_details ($event, $server = "") {
}
$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 = '';
if (isset($module["module_name"])) {

View File

@ -34,7 +34,7 @@ if (! check_acl ($config["id_user"], 0, "ER")) {
// Set metaconsole mode
$meta = false;
if(enterprise_installed() && defined("METACONSOLE")) {
if (enterprise_installed() && defined("METACONSOLE")) {
$meta = true;
}
@ -43,7 +43,7 @@ $history = (bool) get_parameter('history', 0);
$readonly = false;
if(!$meta) {
if (!$meta) {
if (isset($config['event_replication']) &&
$config['event_replication'] == 1) {
@ -226,7 +226,7 @@ $params = "search=" . rawurlencode(io_safe_input($search)) .
"&amp;severity=" . $severity .
"&amp;status=" . $status .
"&amp;ev_group=" . $ev_group .
"&amp;refr=" . $config["refr"] .
"&amp;refr=" . (int)get_parameter("refr", 0) .
"&amp;id_agent=" . $id_agent .
"&amp;pagination=" . $pagination .
"&amp;group_rep=" . $group_rep .
@ -245,7 +245,7 @@ $params = "search=" . rawurlencode(io_safe_input($search)) .
"&amp;open_filter=" . $open_filter .
"&amp;pure=" . $config["pure"];
if($meta) {
if ($meta) {
$params .= "&amp;text_agent=" . $text_agent;
}

View File

@ -327,7 +327,7 @@ $tabletags->rowclass[] = '';
echo '<div id="event_control" style="display:none">';
// Table for filter controls
echo '<form id="form_filter" method="post" action="index.php?sec=eventos&amp;sec2=operation/events/events&amp;refr='.$config["refr"].'&amp;pure='.$config["pure"].'&amp;section=' . $section . '&amp;history='.(int)$history.'">';
echo '<form id="form_filter" method="post" action="index.php?sec=eventos&amp;sec2=operation/events/events&amp;refr='. (int)get_parameter("refr", 0) .'&amp;pure='.$config["pure"].'&amp;section=' . $section . '&amp;history='.(int)$history.'">';
// Hidden field with the loaded filter name
html_print_input_hidden('id_name', $id_name);