2012-03-01 17:41:02 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
// Pandora FMS - http://pandorafms.com
|
|
|
|
// ==================================================
|
|
|
|
// Copyright (c) 2005-2010 Artica Soluciones Tecnologicas
|
|
|
|
// Please see http://pandorafms.org for full contribution list
|
|
|
|
|
|
|
|
// This program is free software; you can redistribute it and/or
|
|
|
|
// modify it under the terms of the GNU General Public License
|
|
|
|
// as published by the Free Software Foundation for version 2.
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License for more details.
|
|
|
|
|
|
|
|
require_once ('include/functions_events.php');
|
2012-10-01 13:15:31 +02:00
|
|
|
require_once ('include/functions_agents.php');
|
|
|
|
require_once ('include/functions_ui.php');
|
2012-03-01 17:41:02 +01:00
|
|
|
require_once ('include/functions_db.php');
|
|
|
|
require_once ('include/functions_io.php');
|
|
|
|
require_once ('include/functions.php');
|
2012-12-18 12:54:22 +01:00
|
|
|
enterprise_include_once ('meta/include/functions_events_meta.php');
|
|
|
|
enterprise_include_once ('include/functions_metaconsole.php');
|
2012-03-01 17:41:02 +01:00
|
|
|
|
|
|
|
$get_events_details = (bool) get_parameter ('get_events_details');
|
2012-10-01 13:15:31 +02:00
|
|
|
$get_extended_event = (bool) get_parameter ('get_extended_event');
|
|
|
|
$change_status = (bool) get_parameter ('change_status');
|
|
|
|
$change_owner = (bool) get_parameter ('change_owner');
|
|
|
|
$add_comment = (bool) get_parameter ('add_comment');
|
2012-10-09 18:05:32 +02:00
|
|
|
$dialogue_event_response = (bool) get_parameter ('dialogue_event_response');
|
|
|
|
$perform_event_response = (bool) get_parameter ('perform_event_response');
|
|
|
|
$get_response = (bool) get_parameter ('get_response');
|
|
|
|
$get_response_target = (bool) get_parameter ('get_response_target');
|
|
|
|
$get_response_params = (bool) get_parameter ('get_response_params');
|
|
|
|
$get_response_description = (bool) get_parameter ('get_response_description');
|
2012-10-11 19:49:17 +02:00
|
|
|
$get_event_name = (bool) get_parameter ('get_event_name');
|
2012-12-18 12:54:22 +01:00
|
|
|
$meta = get_parameter ('meta', 0);
|
2013-01-16 13:57:11 +01:00
|
|
|
$history = get_parameter ('history', 0);
|
2012-10-11 19:49:17 +02:00
|
|
|
|
2013-01-29 19:03:08 +01:00
|
|
|
if ($get_event_name) {
|
2012-10-11 19:49:17 +02:00
|
|
|
$event_id = get_parameter ('event_id');
|
|
|
|
|
2013-07-16 11:09:50 +02:00
|
|
|
if ($meta) {
|
2013-01-16 13:57:11 +01:00
|
|
|
$name = events_meta_get_event_name($event_id, $history);
|
2012-12-18 12:54:22 +01:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
$name = db_get_value('evento','tevento','id_evento',$event_id);
|
|
|
|
}
|
2012-10-11 19:49:17 +02:00
|
|
|
|
2013-07-16 11:09:50 +02:00
|
|
|
if ($name === false) {
|
2012-10-11 19:49:17 +02:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2013-06-10 18:15:36 +02:00
|
|
|
ui_print_truncate_text(io_safe_output($name), 75, false, false, false, '...');
|
2012-10-11 19:49:17 +02:00
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
2012-10-09 18:05:32 +02:00
|
|
|
|
2013-01-29 19:03:08 +01:00
|
|
|
if ($get_response_description) {
|
2012-10-09 18:05:32 +02:00
|
|
|
$response_id = get_parameter ('response_id');
|
|
|
|
|
|
|
|
$description = db_get_value('description','tevent_response','id',$response_id);
|
|
|
|
|
2013-01-29 19:03:08 +01:00
|
|
|
if ($description === false) {
|
2012-10-09 18:05:32 +02:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
$description = io_safe_output($description);
|
|
|
|
$description = str_replace("\r\n", '<br>', $description);
|
2013-01-29 19:03:08 +01:00
|
|
|
|
2012-10-09 18:05:32 +02:00
|
|
|
echo $description;
|
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2013-01-29 19:03:08 +01:00
|
|
|
if ($get_response_params) {
|
2012-10-09 18:05:32 +02:00
|
|
|
$response_id = get_parameter ('response_id');
|
|
|
|
|
|
|
|
$params = db_get_value('params','tevent_response','id',$response_id);
|
|
|
|
|
2013-07-16 11:09:50 +02:00
|
|
|
if ($params === false) {
|
2012-10-09 18:05:32 +02:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
echo json_encode(explode(',',$params));
|
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2013-01-31 Miguel de Dios <miguel.dedios@artica.es>
* include/styles/jquery-ui-1.10.0.custom.css,
include/styles/images/ui-*,
include/javascript/jquery.jquery-ui-1.10.0.custom.js,
include/javascript/jquery-1.9.0.js: added the last version of
jquery and jqueryUI.
* godmode/reporting/visual_console_builder.editor.js,
include/ajax/events.php, include/functions_events.php,
include/functions_reporting.php,
include/javascript/pandora_events.js,
include/javascript/jquery.scrollTo.js,
include/javascript/jquery.tablesorter.pager.js,
include/javascript/jquery.tablesorter.js, include/functions_ui.php,
extensions/update_manager/lib/functions.php,
extensions/update_manager/main.php, extensions/agents_alerts.php,
operation/events/events.php, general/login_page.php,
general/logoff.php, general/header.php,
general/login_help_dialog.php: fixes about the new jquery and
jqueryUI version.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7554 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2013-01-31 17:49:08 +01:00
|
|
|
if ($get_response_target) {
|
2012-10-09 18:05:32 +02:00
|
|
|
$response_id = get_parameter ('response_id');
|
|
|
|
$event_id = get_parameter ('event_id');
|
2012-12-20 16:33:23 +01:00
|
|
|
$server_id = get_parameter ('server_id', 0);
|
2012-10-09 18:05:32 +02:00
|
|
|
|
|
|
|
$event_response = db_get_row('tevent_response','id',$response_id);
|
|
|
|
|
2013-07-16 11:09:50 +02:00
|
|
|
if (empty($event_response)) {
|
2012-10-09 18:05:32 +02:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2012-12-20 16:33:23 +01:00
|
|
|
echo events_get_response_target($event_id, $response_id, $server_id);
|
2012-10-09 18:05:32 +02:00
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2013-01-31 Miguel de Dios <miguel.dedios@artica.es>
* include/styles/jquery-ui-1.10.0.custom.css,
include/styles/images/ui-*,
include/javascript/jquery.jquery-ui-1.10.0.custom.js,
include/javascript/jquery-1.9.0.js: added the last version of
jquery and jqueryUI.
* godmode/reporting/visual_console_builder.editor.js,
include/ajax/events.php, include/functions_events.php,
include/functions_reporting.php,
include/javascript/pandora_events.js,
include/javascript/jquery.scrollTo.js,
include/javascript/jquery.tablesorter.pager.js,
include/javascript/jquery.tablesorter.js, include/functions_ui.php,
extensions/update_manager/lib/functions.php,
extensions/update_manager/main.php, extensions/agents_alerts.php,
operation/events/events.php, general/login_page.php,
general/logoff.php, general/header.php,
general/login_help_dialog.php: fixes about the new jquery and
jqueryUI version.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7554 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2013-01-31 17:49:08 +01:00
|
|
|
if ($get_response) {
|
2012-10-09 18:05:32 +02:00
|
|
|
$response_id = get_parameter ('response_id');
|
|
|
|
|
|
|
|
$event_response = db_get_row('tevent_response','id',$response_id);
|
|
|
|
|
2013-07-16 11:09:50 +02:00
|
|
|
if (empty($event_response)) {
|
2012-10-09 18:05:32 +02:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
echo json_encode($event_response);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2013-07-16 11:09:50 +02:00
|
|
|
if ($perform_event_response) {
|
2012-10-09 18:05:32 +02:00
|
|
|
global $config;
|
2013-07-16 11:09:50 +02:00
|
|
|
|
2012-10-09 18:05:32 +02:00
|
|
|
$command = get_parameter('target','');
|
2013-07-16 11:09:50 +02:00
|
|
|
|
2013-09-29 15:22:53 +02:00
|
|
|
switch (PHP_OS) {
|
|
|
|
case "FreeBSD":
|
|
|
|
$timeout_bin = '/usr/local/bin/gtimeout';
|
|
|
|
break;
|
|
|
|
case "NetBSD":
|
|
|
|
$timeout_bin = '/usr/pkg/bin/gtimeout';
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
$timeout_bin = '/usr/bin/timeout';
|
|
|
|
break;
|
|
|
|
}
|
2014-02-25 13:38:53 +01:00
|
|
|
echo system($timeout_bin . ' 9 '.io_safe_output($command).' 2>&1');
|
2012-10-09 18:05:32 +02:00
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2013-01-31 Miguel de Dios <miguel.dedios@artica.es>
* include/styles/jquery-ui-1.10.0.custom.css,
include/styles/images/ui-*,
include/javascript/jquery.jquery-ui-1.10.0.custom.js,
include/javascript/jquery-1.9.0.js: added the last version of
jquery and jqueryUI.
* godmode/reporting/visual_console_builder.editor.js,
include/ajax/events.php, include/functions_events.php,
include/functions_reporting.php,
include/javascript/pandora_events.js,
include/javascript/jquery.scrollTo.js,
include/javascript/jquery.tablesorter.pager.js,
include/javascript/jquery.tablesorter.js, include/functions_ui.php,
extensions/update_manager/lib/functions.php,
extensions/update_manager/main.php, extensions/agents_alerts.php,
operation/events/events.php, general/login_page.php,
general/logoff.php, general/header.php,
general/login_help_dialog.php: fixes about the new jquery and
jqueryUI version.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7554 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2013-01-31 17:49:08 +01:00
|
|
|
if ($dialogue_event_response) {
|
2012-10-09 18:05:32 +02:00
|
|
|
global $config;
|
|
|
|
|
|
|
|
$event_id = get_parameter ('event_id');
|
|
|
|
$response_id = get_parameter ('response_id');
|
|
|
|
$command = get_parameter ('target');
|
|
|
|
|
|
|
|
$event_response = db_get_row('tevent_response','id',$response_id);
|
|
|
|
|
|
|
|
$event = db_get_row('tevento','id_evento',$event_id);
|
|
|
|
|
|
|
|
$prompt = "<br>> ";
|
2013-01-29 19:03:08 +01:00
|
|
|
|
2012-10-09 18:05:32 +02:00
|
|
|
switch($event_response['type']) {
|
|
|
|
case 'command':
|
|
|
|
echo "<div style='text-align:left'>";
|
|
|
|
echo $prompt.sprintf(__('Executing command: %s',$command));
|
|
|
|
echo "</div><br>";
|
|
|
|
|
|
|
|
echo "<div id='response_loading_command' style='display:none'>".html_print_image('images/spinner.gif', true)."</div>";
|
|
|
|
echo "<br><div id='response_out' style='text-align:left'></div>";
|
2013-01-31 Miguel de Dios <miguel.dedios@artica.es>
* include/styles/jquery-ui-1.10.0.custom.css,
include/styles/images/ui-*,
include/javascript/jquery.jquery-ui-1.10.0.custom.js,
include/javascript/jquery-1.9.0.js: added the last version of
jquery and jqueryUI.
* godmode/reporting/visual_console_builder.editor.js,
include/ajax/events.php, include/functions_events.php,
include/functions_reporting.php,
include/javascript/pandora_events.js,
include/javascript/jquery.scrollTo.js,
include/javascript/jquery.tablesorter.pager.js,
include/javascript/jquery.tablesorter.js, include/functions_ui.php,
extensions/update_manager/lib/functions.php,
extensions/update_manager/main.php, extensions/agents_alerts.php,
operation/events/events.php, general/login_page.php,
general/logoff.php, general/header.php,
general/login_help_dialog.php: fixes about the new jquery and
jqueryUI version.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7554 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2013-01-31 17:49:08 +01:00
|
|
|
|
2012-10-09 18:05:32 +02:00
|
|
|
echo "<br><div id='re_exec_command' style='display:none;'>";
|
|
|
|
html_print_button(__('Execute again'),'btn_str',false,'perform_response(\''.$command.'\');', "class='sub next'");
|
|
|
|
echo "</div>";
|
|
|
|
break;
|
|
|
|
case 'url':
|
|
|
|
echo "<iframe src='$command' id='divframe' style='width:100%;height:90%;'></iframe>";
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2012-10-01 13:15:31 +02:00
|
|
|
|
2013-02-20 Miguel de Dios <miguel.dedios@artica.es>
* godmode/servers/recon_script.php, godmode/servers/plugin.php,
godmode/snmpconsole/snmp_filters.php,
godmode/massive/massive_delete_alerts.php,
godmode/massive/massive_enable_disable_alerts.php,
godmode/massive/massive_edit_agents.php,
godmode/massive/massive_delete_modules.php,
godmode/massive/massive_add_action_alerts.php,
godmode/massive/massive_delete_action_alerts.php: improved the code
style.
* include/ajax/events.php, include/functions_events.php,
operation/agentes/custom_fields.php: fixed the show admin custom
fields for user without permisitions.
Fixes: #3605278
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7683 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2013-02-20 13:07:00 +01:00
|
|
|
if ($add_comment) {
|
2012-10-01 13:15:31 +02:00
|
|
|
$comment = get_parameter ('comment');
|
|
|
|
$event_id = get_parameter ('event_id');
|
2013-02-20 Miguel de Dios <miguel.dedios@artica.es>
* godmode/servers/recon_script.php, godmode/servers/plugin.php,
godmode/snmpconsole/snmp_filters.php,
godmode/massive/massive_delete_alerts.php,
godmode/massive/massive_enable_disable_alerts.php,
godmode/massive/massive_edit_agents.php,
godmode/massive/massive_delete_modules.php,
godmode/massive/massive_add_action_alerts.php,
godmode/massive/massive_delete_action_alerts.php: improved the code
style.
* include/ajax/events.php, include/functions_events.php,
operation/agentes/custom_fields.php: fixed the show admin custom
fields for user without permisitions.
Fixes: #3605278
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7683 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2013-02-20 13:07:00 +01:00
|
|
|
|
2013-01-16 13:57:11 +01:00
|
|
|
$return = events_comment ($event_id, $comment, 'Added comment', $meta, $history);
|
2013-02-20 Miguel de Dios <miguel.dedios@artica.es>
* godmode/servers/recon_script.php, godmode/servers/plugin.php,
godmode/snmpconsole/snmp_filters.php,
godmode/massive/massive_delete_alerts.php,
godmode/massive/massive_enable_disable_alerts.php,
godmode/massive/massive_edit_agents.php,
godmode/massive/massive_delete_modules.php,
godmode/massive/massive_add_action_alerts.php,
godmode/massive/massive_delete_action_alerts.php: improved the code
style.
* include/ajax/events.php, include/functions_events.php,
operation/agentes/custom_fields.php: fixed the show admin custom
fields for user without permisitions.
Fixes: #3605278
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7683 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2013-02-20 13:07:00 +01:00
|
|
|
|
2012-10-01 13:15:31 +02:00
|
|
|
if ($return)
|
|
|
|
echo 'comment_ok';
|
|
|
|
else
|
|
|
|
echo 'comment_error';
|
2013-02-20 Miguel de Dios <miguel.dedios@artica.es>
* godmode/servers/recon_script.php, godmode/servers/plugin.php,
godmode/snmpconsole/snmp_filters.php,
godmode/massive/massive_delete_alerts.php,
godmode/massive/massive_enable_disable_alerts.php,
godmode/massive/massive_edit_agents.php,
godmode/massive/massive_delete_modules.php,
godmode/massive/massive_add_action_alerts.php,
godmode/massive/massive_delete_action_alerts.php: improved the code
style.
* include/ajax/events.php, include/functions_events.php,
operation/agentes/custom_fields.php: fixed the show admin custom
fields for user without permisitions.
Fixes: #3605278
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7683 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2013-02-20 13:07:00 +01:00
|
|
|
|
2012-10-01 13:15:31 +02:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2013-02-20 Miguel de Dios <miguel.dedios@artica.es>
* godmode/servers/recon_script.php, godmode/servers/plugin.php,
godmode/snmpconsole/snmp_filters.php,
godmode/massive/massive_delete_alerts.php,
godmode/massive/massive_enable_disable_alerts.php,
godmode/massive/massive_edit_agents.php,
godmode/massive/massive_delete_modules.php,
godmode/massive/massive_add_action_alerts.php,
godmode/massive/massive_delete_action_alerts.php: improved the code
style.
* include/ajax/events.php, include/functions_events.php,
operation/agentes/custom_fields.php: fixed the show admin custom
fields for user without permisitions.
Fixes: #3605278
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7683 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2013-02-20 13:07:00 +01:00
|
|
|
if ($change_status) {
|
2012-10-11 19:49:17 +02:00
|
|
|
$event_ids = get_parameter ('event_ids');
|
2012-10-01 13:15:31 +02:00
|
|
|
$new_status = get_parameter ('new_status');
|
|
|
|
|
2013-01-16 13:57:11 +01:00
|
|
|
$return = events_change_status (explode(',',$event_ids), $new_status, $meta, $history);
|
2013-02-20 Miguel de Dios <miguel.dedios@artica.es>
* godmode/servers/recon_script.php, godmode/servers/plugin.php,
godmode/snmpconsole/snmp_filters.php,
godmode/massive/massive_delete_alerts.php,
godmode/massive/massive_enable_disable_alerts.php,
godmode/massive/massive_edit_agents.php,
godmode/massive/massive_delete_modules.php,
godmode/massive/massive_add_action_alerts.php,
godmode/massive/massive_delete_action_alerts.php: improved the code
style.
* include/ajax/events.php, include/functions_events.php,
operation/agentes/custom_fields.php: fixed the show admin custom
fields for user without permisitions.
Fixes: #3605278
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7683 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2013-02-20 13:07:00 +01:00
|
|
|
|
2012-10-01 13:15:31 +02:00
|
|
|
if ($return)
|
|
|
|
echo 'status_ok';
|
|
|
|
else
|
|
|
|
echo 'status_error';
|
2013-02-20 Miguel de Dios <miguel.dedios@artica.es>
* godmode/servers/recon_script.php, godmode/servers/plugin.php,
godmode/snmpconsole/snmp_filters.php,
godmode/massive/massive_delete_alerts.php,
godmode/massive/massive_enable_disable_alerts.php,
godmode/massive/massive_edit_agents.php,
godmode/massive/massive_delete_modules.php,
godmode/massive/massive_add_action_alerts.php,
godmode/massive/massive_delete_action_alerts.php: improved the code
style.
* include/ajax/events.php, include/functions_events.php,
operation/agentes/custom_fields.php: fixed the show admin custom
fields for user without permisitions.
Fixes: #3605278
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7683 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2013-02-20 13:07:00 +01:00
|
|
|
|
2012-10-01 13:15:31 +02:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2013-02-20 Miguel de Dios <miguel.dedios@artica.es>
* godmode/servers/recon_script.php, godmode/servers/plugin.php,
godmode/snmpconsole/snmp_filters.php,
godmode/massive/massive_delete_alerts.php,
godmode/massive/massive_enable_disable_alerts.php,
godmode/massive/massive_edit_agents.php,
godmode/massive/massive_delete_modules.php,
godmode/massive/massive_add_action_alerts.php,
godmode/massive/massive_delete_action_alerts.php: improved the code
style.
* include/ajax/events.php, include/functions_events.php,
operation/agentes/custom_fields.php: fixed the show admin custom
fields for user without permisitions.
Fixes: #3605278
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7683 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2013-02-20 13:07:00 +01:00
|
|
|
if ($change_owner) {
|
2012-10-01 13:15:31 +02:00
|
|
|
$new_owner = get_parameter ('new_owner');
|
|
|
|
$event_id = get_parameter ('event_id');
|
|
|
|
$similars = true;
|
|
|
|
|
2013-07-16 11:09:50 +02:00
|
|
|
if ($new_owner == -1) {
|
2012-10-01 13:15:31 +02:00
|
|
|
$new_owner = '';
|
|
|
|
}
|
2013-02-20 Miguel de Dios <miguel.dedios@artica.es>
* godmode/servers/recon_script.php, godmode/servers/plugin.php,
godmode/snmpconsole/snmp_filters.php,
godmode/massive/massive_delete_alerts.php,
godmode/massive/massive_enable_disable_alerts.php,
godmode/massive/massive_edit_agents.php,
godmode/massive/massive_delete_modules.php,
godmode/massive/massive_add_action_alerts.php,
godmode/massive/massive_delete_action_alerts.php: improved the code
style.
* include/ajax/events.php, include/functions_events.php,
operation/agentes/custom_fields.php: fixed the show admin custom
fields for user without permisitions.
Fixes: #3605278
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7683 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2013-02-20 13:07:00 +01:00
|
|
|
|
2013-01-16 13:57:11 +01:00
|
|
|
$return = events_change_owner($event_id, $new_owner, true, $meta, $history);
|
2013-02-20 Miguel de Dios <miguel.dedios@artica.es>
* godmode/servers/recon_script.php, godmode/servers/plugin.php,
godmode/snmpconsole/snmp_filters.php,
godmode/massive/massive_delete_alerts.php,
godmode/massive/massive_enable_disable_alerts.php,
godmode/massive/massive_edit_agents.php,
godmode/massive/massive_delete_modules.php,
godmode/massive/massive_add_action_alerts.php,
godmode/massive/massive_delete_action_alerts.php: improved the code
style.
* include/ajax/events.php, include/functions_events.php,
operation/agentes/custom_fields.php: fixed the show admin custom
fields for user without permisitions.
Fixes: #3605278
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7683 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2013-02-20 13:07:00 +01:00
|
|
|
|
2012-10-01 13:15:31 +02:00
|
|
|
if ($return)
|
|
|
|
echo 'owner_ok';
|
|
|
|
else
|
|
|
|
echo 'owner_error';
|
2013-02-20 Miguel de Dios <miguel.dedios@artica.es>
* godmode/servers/recon_script.php, godmode/servers/plugin.php,
godmode/snmpconsole/snmp_filters.php,
godmode/massive/massive_delete_alerts.php,
godmode/massive/massive_enable_disable_alerts.php,
godmode/massive/massive_edit_agents.php,
godmode/massive/massive_delete_modules.php,
godmode/massive/massive_add_action_alerts.php,
godmode/massive/massive_delete_action_alerts.php: improved the code
style.
* include/ajax/events.php, include/functions_events.php,
operation/agentes/custom_fields.php: fixed the show admin custom
fields for user without permisitions.
Fixes: #3605278
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7683 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2013-02-20 13:07:00 +01:00
|
|
|
|
2012-10-01 13:15:31 +02:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2013-02-20 Miguel de Dios <miguel.dedios@artica.es>
* godmode/servers/recon_script.php, godmode/servers/plugin.php,
godmode/snmpconsole/snmp_filters.php,
godmode/massive/massive_delete_alerts.php,
godmode/massive/massive_enable_disable_alerts.php,
godmode/massive/massive_edit_agents.php,
godmode/massive/massive_delete_modules.php,
godmode/massive/massive_add_action_alerts.php,
godmode/massive/massive_delete_action_alerts.php: improved the code
style.
* include/ajax/events.php, include/functions_events.php,
operation/agentes/custom_fields.php: fixed the show admin custom
fields for user without permisitions.
Fixes: #3605278
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7683 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2013-02-20 13:07:00 +01:00
|
|
|
if ($get_extended_event) {
|
2012-10-01 13:15:31 +02:00
|
|
|
global $config;
|
|
|
|
|
|
|
|
$event_id = get_parameter('event_id',false);
|
2013-02-20 Miguel de Dios <miguel.dedios@artica.es>
* godmode/servers/recon_script.php, godmode/servers/plugin.php,
godmode/snmpconsole/snmp_filters.php,
godmode/massive/massive_delete_alerts.php,
godmode/massive/massive_enable_disable_alerts.php,
godmode/massive/massive_edit_agents.php,
godmode/massive/massive_delete_modules.php,
godmode/massive/massive_add_action_alerts.php,
godmode/massive/massive_delete_action_alerts.php: improved the code
style.
* include/ajax/events.php, include/functions_events.php,
operation/agentes/custom_fields.php: fixed the show admin custom
fields for user without permisitions.
Fixes: #3605278
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7683 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2013-02-20 13:07:00 +01:00
|
|
|
|
|
|
|
if ($meta) {
|
2013-01-16 13:57:11 +01:00
|
|
|
$event = events_meta_get_event($event_id, false, $history);
|
2012-12-18 12:54:22 +01:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
$event = events_get_event($event_id);
|
|
|
|
}
|
2013-01-09 10:25:07 +01:00
|
|
|
|
2013-04-16 12:10:44 +02:00
|
|
|
$readonly = false;
|
2013-07-16 11:09:50 +02:00
|
|
|
if (!$meta &&
|
2013-04-16 12:10:44 +02:00
|
|
|
isset($config['event_replication']) &&
|
|
|
|
$config['event_replication'] == 1 &&
|
|
|
|
$config['show_events_in_local'] == 1) {
|
|
|
|
$readonly = true;
|
|
|
|
}
|
2013-07-16 11:09:50 +02:00
|
|
|
|
2013-01-09 10:25:07 +01:00
|
|
|
// Clean url from events and store in array
|
|
|
|
$event['clean_tags'] = events_clean_tags($event['tags']);
|
2013-02-20 Miguel de Dios <miguel.dedios@artica.es>
* godmode/servers/recon_script.php, godmode/servers/plugin.php,
godmode/snmpconsole/snmp_filters.php,
godmode/massive/massive_delete_alerts.php,
godmode/massive/massive_enable_disable_alerts.php,
godmode/massive/massive_edit_agents.php,
godmode/massive/massive_delete_modules.php,
godmode/massive/massive_add_action_alerts.php,
godmode/massive/massive_delete_action_alerts.php: improved the code
style.
* include/ajax/events.php, include/functions_events.php,
operation/agentes/custom_fields.php: fixed the show admin custom
fields for user without permisitions.
Fixes: #3605278
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7683 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2013-02-20 13:07:00 +01:00
|
|
|
|
2012-10-09 18:05:32 +02:00
|
|
|
// If the event is not found, we abort
|
2013-02-20 Miguel de Dios <miguel.dedios@artica.es>
* godmode/servers/recon_script.php, godmode/servers/plugin.php,
godmode/snmpconsole/snmp_filters.php,
godmode/massive/massive_delete_alerts.php,
godmode/massive/massive_enable_disable_alerts.php,
godmode/massive/massive_edit_agents.php,
godmode/massive/massive_delete_modules.php,
godmode/massive/massive_add_action_alerts.php,
godmode/massive/massive_delete_action_alerts.php: improved the code
style.
* include/ajax/events.php, include/functions_events.php,
operation/agentes/custom_fields.php: fixed the show admin custom
fields for user without permisitions.
Fixes: #3605278
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7683 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2013-02-20 13:07:00 +01:00
|
|
|
if (empty($event)) {
|
2012-12-18 12:54:22 +01:00
|
|
|
ui_print_error_message('Event not found');
|
2012-10-09 18:05:32 +02:00
|
|
|
return false;
|
|
|
|
}
|
2013-02-20 Miguel de Dios <miguel.dedios@artica.es>
* godmode/servers/recon_script.php, godmode/servers/plugin.php,
godmode/snmpconsole/snmp_filters.php,
godmode/massive/massive_delete_alerts.php,
godmode/massive/massive_enable_disable_alerts.php,
godmode/massive/massive_edit_agents.php,
godmode/massive/massive_delete_modules.php,
godmode/massive/massive_add_action_alerts.php,
godmode/massive/massive_delete_action_alerts.php: improved the code
style.
* include/ajax/events.php, include/functions_events.php,
operation/agentes/custom_fields.php: fixed the show admin custom
fields for user without permisitions.
Fixes: #3605278
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7683 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2013-02-20 13:07:00 +01:00
|
|
|
|
2012-10-11 19:49:17 +02:00
|
|
|
$dialog_page = get_parameter('dialog_page','general');
|
|
|
|
$similar_ids = get_parameter('similar_ids', $event_id);
|
|
|
|
$group_rep = get_parameter('group_rep',false);
|
|
|
|
$event_rep = get_parameter('event_rep',1);
|
|
|
|
$timestamp_first = get_parameter('timestamp_first', $event['utimestamp']);
|
|
|
|
$timestamp_last = get_parameter('timestamp_last', $event['utimestamp']);
|
2012-12-18 12:54:22 +01:00
|
|
|
$server_id = get_parameter('server_id', 0);
|
2013-02-20 Miguel de Dios <miguel.dedios@artica.es>
* godmode/servers/recon_script.php, godmode/servers/plugin.php,
godmode/snmpconsole/snmp_filters.php,
godmode/massive/massive_delete_alerts.php,
godmode/massive/massive_enable_disable_alerts.php,
godmode/massive/massive_edit_agents.php,
godmode/massive/massive_delete_modules.php,
godmode/massive/massive_add_action_alerts.php,
godmode/massive/massive_delete_action_alerts.php: improved the code
style.
* include/ajax/events.php, include/functions_events.php,
operation/agentes/custom_fields.php: fixed the show admin custom
fields for user without permisitions.
Fixes: #3605278
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7683 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2013-02-20 13:07:00 +01:00
|
|
|
|
2012-10-11 19:49:17 +02:00
|
|
|
$event['similar_ids'] = $similar_ids;
|
|
|
|
$event['timestamp_first'] = $timestamp_first;
|
|
|
|
$event['timestamp_last'] = $timestamp_last;
|
|
|
|
$event['event_rep'] = $event_rep;
|
2013-02-20 Miguel de Dios <miguel.dedios@artica.es>
* godmode/servers/recon_script.php, godmode/servers/plugin.php,
godmode/snmpconsole/snmp_filters.php,
godmode/massive/massive_delete_alerts.php,
godmode/massive/massive_enable_disable_alerts.php,
godmode/massive/massive_edit_agents.php,
godmode/massive/massive_delete_modules.php,
godmode/massive/massive_add_action_alerts.php,
godmode/massive/massive_delete_action_alerts.php: improved the code
style.
* include/ajax/events.php, include/functions_events.php,
operation/agentes/custom_fields.php: fixed the show admin custom
fields for user without permisitions.
Fixes: #3605278
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7683 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2013-02-20 13:07:00 +01:00
|
|
|
|
2012-10-09 18:05:32 +02:00
|
|
|
// Check ACLs
|
|
|
|
if (is_user_admin ($config["id_user"])) {
|
|
|
|
//Do nothing if you're admin, you get full access
|
|
|
|
}
|
2013-02-20 Miguel de Dios <miguel.dedios@artica.es>
* godmode/servers/recon_script.php, godmode/servers/plugin.php,
godmode/snmpconsole/snmp_filters.php,
godmode/massive/massive_delete_alerts.php,
godmode/massive/massive_enable_disable_alerts.php,
godmode/massive/massive_edit_agents.php,
godmode/massive/massive_delete_modules.php,
godmode/massive/massive_add_action_alerts.php,
godmode/massive/massive_delete_action_alerts.php: improved the code
style.
* include/ajax/events.php, include/functions_events.php,
operation/agentes/custom_fields.php: fixed the show admin custom
fields for user without permisitions.
Fixes: #3605278
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7683 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2013-02-20 13:07:00 +01:00
|
|
|
else if ($config["id_user"] == $event['owner_user']) {
|
2012-10-09 18:05:32 +02:00
|
|
|
//Do nothing if you're the owner user, you get access
|
|
|
|
}
|
2013-02-20 Miguel de Dios <miguel.dedios@artica.es>
* godmode/servers/recon_script.php, godmode/servers/plugin.php,
godmode/snmpconsole/snmp_filters.php,
godmode/massive/massive_delete_alerts.php,
godmode/massive/massive_enable_disable_alerts.php,
godmode/massive/massive_edit_agents.php,
godmode/massive/massive_delete_modules.php,
godmode/massive/massive_add_action_alerts.php,
godmode/massive/massive_delete_action_alerts.php: improved the code
style.
* include/ajax/events.php, include/functions_events.php,
operation/agentes/custom_fields.php: fixed the show admin custom
fields for user without permisitions.
Fixes: #3605278
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7683 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2013-02-20 13:07:00 +01:00
|
|
|
else if ($event['id_grupo'] == 0) {
|
2012-10-09 18:05:32 +02:00
|
|
|
//If the event has access to all groups, you get access
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
// Get your groups
|
2012-12-28 18:06:17 +01:00
|
|
|
$groups = users_get_groups($config['id_user'], 'ER');
|
2012-10-09 18:05:32 +02:00
|
|
|
|
2013-02-20 Miguel de Dios <miguel.dedios@artica.es>
* godmode/servers/recon_script.php, godmode/servers/plugin.php,
godmode/snmpconsole/snmp_filters.php,
godmode/massive/massive_delete_alerts.php,
godmode/massive/massive_enable_disable_alerts.php,
godmode/massive/massive_edit_agents.php,
godmode/massive/massive_delete_modules.php,
godmode/massive/massive_add_action_alerts.php,
godmode/massive/massive_delete_action_alerts.php: improved the code
style.
* include/ajax/events.php, include/functions_events.php,
operation/agentes/custom_fields.php: fixed the show admin custom
fields for user without permisitions.
Fixes: #3605278
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7683 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2013-02-20 13:07:00 +01:00
|
|
|
if (in_array ($event['id_grupo'], array_keys ($groups))) {
|
2012-10-09 18:05:32 +02:00
|
|
|
//If the event group is among the groups of the user, you get access
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
// If all the access types fail, abort
|
2012-12-28 18:06:17 +01:00
|
|
|
echo 'Access denied';
|
2012-10-09 18:05:32 +02:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
2012-10-01 13:15:31 +02:00
|
|
|
|
|
|
|
// Print group_rep in a hidden field to recover it from javascript
|
2012-10-09 18:05:32 +02:00
|
|
|
html_print_input_hidden('group_rep',(int)$group_rep);
|
2013-02-20 Miguel de Dios <miguel.dedios@artica.es>
* godmode/servers/recon_script.php, godmode/servers/plugin.php,
godmode/snmpconsole/snmp_filters.php,
godmode/massive/massive_delete_alerts.php,
godmode/massive/massive_enable_disable_alerts.php,
godmode/massive/massive_edit_agents.php,
godmode/massive/massive_delete_modules.php,
godmode/massive/massive_add_action_alerts.php,
godmode/massive/massive_delete_action_alerts.php: improved the code
style.
* include/ajax/events.php, include/functions_events.php,
operation/agentes/custom_fields.php: fixed the show admin custom
fields for user without permisitions.
Fixes: #3605278
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7683 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2013-02-20 13:07:00 +01:00
|
|
|
|
|
|
|
if ($event === false) {
|
2012-10-01 13:15:31 +02:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Tabs
|
2012-12-28 18:06:17 +01:00
|
|
|
$tabs = "<ul style='background:#eeeeee;border:0px'>";
|
2013-02-20 Miguel de Dios <miguel.dedios@artica.es>
* godmode/servers/recon_script.php, godmode/servers/plugin.php,
godmode/snmpconsole/snmp_filters.php,
godmode/massive/massive_delete_alerts.php,
godmode/massive/massive_enable_disable_alerts.php,
godmode/massive/massive_edit_agents.php,
godmode/massive/massive_delete_modules.php,
godmode/massive/massive_add_action_alerts.php,
godmode/massive/massive_delete_action_alerts.php: improved the code
style.
* include/ajax/events.php, include/functions_events.php,
operation/agentes/custom_fields.php: fixed the show admin custom
fields for user without permisitions.
Fixes: #3605278
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7683 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2013-02-20 13:07:00 +01:00
|
|
|
$tabs .= "<li><a href='#extended_event_general_page' id='link_general'>".html_print_image('images/lightning_go.png',true).__('General')."</a></li>";
|
|
|
|
$tabs .= "<li><a href='#extended_event_details_page' id='link_details'>".html_print_image('images/zoom.png',true).__('Details')."</a></li>";
|
2013-04-10 09:57:54 +02:00
|
|
|
$tabs .= "<li><a href='#extended_event_custom_fields_page' id='link_custom_fields'>".html_print_image('images/custom_field_col.png',true).__('Agent fields')."</a></li>";
|
2013-02-20 Miguel de Dios <miguel.dedios@artica.es>
* godmode/servers/recon_script.php, godmode/servers/plugin.php,
godmode/snmpconsole/snmp_filters.php,
godmode/massive/massive_delete_alerts.php,
godmode/massive/massive_enable_disable_alerts.php,
godmode/massive/massive_edit_agents.php,
godmode/massive/massive_delete_modules.php,
godmode/massive/massive_add_action_alerts.php,
godmode/massive/massive_delete_action_alerts.php: improved the code
style.
* include/ajax/events.php, include/functions_events.php,
operation/agentes/custom_fields.php: fixed the show admin custom
fields for user without permisitions.
Fixes: #3605278
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7683 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2013-02-20 13:07:00 +01:00
|
|
|
$tabs .= "<li><a href='#extended_event_comments_page' id='link_comments'>".html_print_image('images/pencil.png',true).__('Comments')."</a></li>";
|
2013-04-16 12:10:44 +02:00
|
|
|
if (!$readonly &&
|
|
|
|
(tags_check_acl ($config['id_user'], $event['id_grupo'], "EW", $event['clean_tags']) || tags_check_acl ($config['id_user'], $event['id_grupo'], "EM", $event['clean_tags']))) {
|
2013-04-23 16:57:29 +02:00
|
|
|
$tabs .= "<li><a href='#extended_event_responses_page' id='link_responses'>".html_print_image('images/event_responses_col.png',true).__('Responses')."</a></li>";
|
2012-12-28 18:06:17 +01:00
|
|
|
}
|
2013-09-09 18:21:45 +02:00
|
|
|
if ($event['custom_data'] != '') {
|
|
|
|
$tabs .= "<li><a href='#extended_event_custom_data_page' id='link_custom_data'>".html_print_image('images/custom_field_col.png',true).__('Custom data')."</a></li>";
|
|
|
|
}
|
2013-02-20 Miguel de Dios <miguel.dedios@artica.es>
* godmode/servers/recon_script.php, godmode/servers/plugin.php,
godmode/snmpconsole/snmp_filters.php,
godmode/massive/massive_delete_alerts.php,
godmode/massive/massive_enable_disable_alerts.php,
godmode/massive/massive_edit_agents.php,
godmode/massive/massive_delete_modules.php,
godmode/massive/massive_add_action_alerts.php,
godmode/massive/massive_delete_action_alerts.php: improved the code
style.
* include/ajax/events.php, include/functions_events.php,
operation/agentes/custom_fields.php: fixed the show admin custom
fields for user without permisitions.
Fixes: #3605278
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7683 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2013-02-20 13:07:00 +01:00
|
|
|
$tabs .= "</ul>";
|
2012-10-01 13:15:31 +02:00
|
|
|
|
|
|
|
// Get criticity image
|
|
|
|
switch ($event["criticity"]) {
|
|
|
|
default:
|
|
|
|
case 0:
|
|
|
|
$img_sev = "images/status_sets/default/severity_maintenance.png";
|
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
$img_sev = "images/status_sets/default/severity_informational.png";
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
$img_sev = "images/status_sets/default/severity_normal.png";
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
$img_sev = "images/status_sets/default/severity_warning.png";
|
|
|
|
break;
|
|
|
|
case 4:
|
|
|
|
$img_sev = "images/status_sets/default/severity_critical.png";
|
|
|
|
break;
|
|
|
|
case 5:
|
|
|
|
$img_sev = "images/status_sets/default/severity_minor.png";
|
|
|
|
break;
|
|
|
|
case 6:
|
|
|
|
$img_sev = "images/status_sets/default/severity_major.png";
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2013-04-16 12:10:44 +02:00
|
|
|
if (!$readonly &&
|
|
|
|
(tags_check_acl ($config['id_user'], $event['id_grupo'], "EW", $event['clean_tags']) || tags_check_acl ($config['id_user'], $event['id_grupo'], "EM", $event['clean_tags']))) {
|
2012-12-28 18:06:17 +01:00
|
|
|
$responses = events_page_responses($event);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$responses = '';
|
|
|
|
}
|
2012-10-01 13:15:31 +02:00
|
|
|
|
2012-12-18 12:54:22 +01:00
|
|
|
$console_url = '';
|
|
|
|
// If metaconsole switch to node to get details and custom fields
|
2013-02-20 Miguel de Dios <miguel.dedios@artica.es>
* godmode/servers/recon_script.php, godmode/servers/plugin.php,
godmode/snmpconsole/snmp_filters.php,
godmode/massive/massive_delete_alerts.php,
godmode/massive/massive_enable_disable_alerts.php,
godmode/massive/massive_edit_agents.php,
godmode/massive/massive_delete_modules.php,
godmode/massive/massive_add_action_alerts.php,
godmode/massive/massive_delete_action_alerts.php: improved the code
style.
* include/ajax/events.php, include/functions_events.php,
operation/agentes/custom_fields.php: fixed the show admin custom
fields for user without permisitions.
Fixes: #3605278
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7683 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2013-02-20 13:07:00 +01:00
|
|
|
if ($meta) {
|
2012-12-18 12:54:22 +01:00
|
|
|
$server = metaconsole_get_connection_by_id ($server_id);
|
|
|
|
metaconsole_connect($server);
|
|
|
|
}
|
2013-01-16 13:57:11 +01:00
|
|
|
else {
|
|
|
|
$server = "";
|
|
|
|
}
|
2013-02-20 Miguel de Dios <miguel.dedios@artica.es>
* godmode/servers/recon_script.php, godmode/servers/plugin.php,
godmode/snmpconsole/snmp_filters.php,
godmode/massive/massive_delete_alerts.php,
godmode/massive/massive_enable_disable_alerts.php,
godmode/massive/massive_edit_agents.php,
godmode/massive/massive_delete_modules.php,
godmode/massive/massive_add_action_alerts.php,
godmode/massive/massive_delete_action_alerts.php: improved the code
style.
* include/ajax/events.php, include/functions_events.php,
operation/agentes/custom_fields.php: fixed the show admin custom
fields for user without permisitions.
Fixes: #3605278
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7683 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2013-02-20 13:07:00 +01:00
|
|
|
|
2012-12-18 12:54:22 +01:00
|
|
|
$details = events_page_details($event, $server);
|
2012-10-01 13:15:31 +02:00
|
|
|
|
|
|
|
$custom_fields = events_page_custom_fields($event);
|
2013-02-20 Miguel de Dios <miguel.dedios@artica.es>
* godmode/servers/recon_script.php, godmode/servers/plugin.php,
godmode/snmpconsole/snmp_filters.php,
godmode/massive/massive_delete_alerts.php,
godmode/massive/massive_enable_disable_alerts.php,
godmode/massive/massive_edit_agents.php,
godmode/massive/massive_delete_modules.php,
godmode/massive/massive_add_action_alerts.php,
godmode/massive/massive_delete_action_alerts.php: improved the code
style.
* include/ajax/events.php, include/functions_events.php,
operation/agentes/custom_fields.php: fixed the show admin custom
fields for user without permisitions.
Fixes: #3605278
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7683 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2013-02-20 13:07:00 +01:00
|
|
|
|
2013-09-09 18:21:45 +02:00
|
|
|
$custom_data = events_page_custom_data($event);
|
|
|
|
|
2013-02-20 Miguel de Dios <miguel.dedios@artica.es>
* godmode/servers/recon_script.php, godmode/servers/plugin.php,
godmode/snmpconsole/snmp_filters.php,
godmode/massive/massive_delete_alerts.php,
godmode/massive/massive_enable_disable_alerts.php,
godmode/massive/massive_edit_agents.php,
godmode/massive/massive_delete_modules.php,
godmode/massive/massive_add_action_alerts.php,
godmode/massive/massive_delete_action_alerts.php: improved the code
style.
* include/ajax/events.php, include/functions_events.php,
operation/agentes/custom_fields.php: fixed the show admin custom
fields for user without permisitions.
Fixes: #3605278
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7683 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2013-02-20 13:07:00 +01:00
|
|
|
if ($meta) {
|
2012-12-20 16:33:23 +01:00
|
|
|
metaconsole_restore_db_force();
|
2012-12-18 12:54:22 +01:00
|
|
|
}
|
|
|
|
|
2012-10-01 13:15:31 +02:00
|
|
|
$general = events_page_general($event);
|
|
|
|
|
|
|
|
$comments = events_page_comments($event);
|
|
|
|
|
|
|
|
$notifications = '<div id="notification_comment_error" style="display:none">'.ui_print_error_message(__('Error adding comment'),'',true).'</div>';
|
|
|
|
$notifications .= '<div id="notification_comment_success" style="display:none">'.ui_print_success_message(__('Comment added successfully'),'',true).'</div>';
|
2012-10-09 18:05:32 +02:00
|
|
|
$notifications .= '<div id="notification_status_error" style="display:none">'.ui_print_error_message(__('Error changing event status'),'',true).'</div>';
|
2012-10-01 13:15:31 +02:00
|
|
|
$notifications .= '<div id="notification_status_success" style="display:none">'.ui_print_success_message(__('Event status changed successfully'),'',true).'</div>';
|
2012-10-09 18:05:32 +02:00
|
|
|
$notifications .= '<div id="notification_owner_error" style="display:none">'.ui_print_error_message(__('Error changing event owner'),'',true).'</div>';
|
2012-10-01 13:15:31 +02:00
|
|
|
$notifications .= '<div id="notification_owner_success" style="display:none">'.ui_print_success_message(__('Event owner changed successfully'),'',true).'</div>';
|
2013-02-20 Miguel de Dios <miguel.dedios@artica.es>
* godmode/servers/recon_script.php, godmode/servers/plugin.php,
godmode/snmpconsole/snmp_filters.php,
godmode/massive/massive_delete_alerts.php,
godmode/massive/massive_enable_disable_alerts.php,
godmode/massive/massive_edit_agents.php,
godmode/massive/massive_delete_modules.php,
godmode/massive/massive_add_action_alerts.php,
godmode/massive/massive_delete_action_alerts.php: improved the code
style.
* include/ajax/events.php, include/functions_events.php,
operation/agentes/custom_fields.php: fixed the show admin custom
fields for user without permisitions.
Fixes: #3605278
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7683 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2013-02-20 13:07:00 +01:00
|
|
|
|
2012-10-09 18:05:32 +02:00
|
|
|
$loading = '<div id="response_loading" style="display:none">'.html_print_image('images/spinner.gif',true).'</div>';
|
|
|
|
|
|
|
|
$out = '<div id="tabs" style="height:95%; overflow: auto">'.
|
|
|
|
$tabs.
|
|
|
|
$notifications.
|
|
|
|
$loading.
|
|
|
|
$general.
|
|
|
|
$details.
|
|
|
|
$custom_fields.
|
|
|
|
$comments.
|
|
|
|
$responses.
|
2013-09-09 18:21:45 +02:00
|
|
|
$custom_data.
|
2012-10-09 18:05:32 +02:00
|
|
|
html_print_input_hidden('id_event',$event['id_evento']).
|
|
|
|
'</div>';
|
2012-10-01 13:15:31 +02:00
|
|
|
|
|
|
|
$js = '<script>
|
|
|
|
$(function() {
|
|
|
|
$tabs = $( "#tabs" ).tabs({
|
|
|
|
});
|
|
|
|
';
|
|
|
|
|
2012-10-09 18:05:32 +02:00
|
|
|
// Load the required tab
|
2013-02-20 Miguel de Dios <miguel.dedios@artica.es>
* godmode/servers/recon_script.php, godmode/servers/plugin.php,
godmode/snmpconsole/snmp_filters.php,
godmode/massive/massive_delete_alerts.php,
godmode/massive/massive_enable_disable_alerts.php,
godmode/massive/massive_edit_agents.php,
godmode/massive/massive_delete_modules.php,
godmode/massive/massive_add_action_alerts.php,
godmode/massive/massive_delete_action_alerts.php: improved the code
style.
* include/ajax/events.php, include/functions_events.php,
operation/agentes/custom_fields.php: fixed the show admin custom
fields for user without permisitions.
Fixes: #3605278
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7683 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2013-02-20 13:07:00 +01:00
|
|
|
switch ($dialog_page) {
|
2012-10-01 13:15:31 +02:00
|
|
|
case "general":
|
2013-01-31 Miguel de Dios <miguel.dedios@artica.es>
* include/styles/jquery-ui-1.10.0.custom.css,
include/styles/images/ui-*,
include/javascript/jquery.jquery-ui-1.10.0.custom.js,
include/javascript/jquery-1.9.0.js: added the last version of
jquery and jqueryUI.
* godmode/reporting/visual_console_builder.editor.js,
include/ajax/events.php, include/functions_events.php,
include/functions_reporting.php,
include/javascript/pandora_events.js,
include/javascript/jquery.scrollTo.js,
include/javascript/jquery.tablesorter.pager.js,
include/javascript/jquery.tablesorter.js, include/functions_ui.php,
extensions/update_manager/lib/functions.php,
extensions/update_manager/main.php, extensions/agents_alerts.php,
operation/events/events.php, general/login_page.php,
general/logoff.php, general/header.php,
general/login_help_dialog.php: fixes about the new jquery and
jqueryUI version.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7554 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2013-01-31 17:49:08 +01:00
|
|
|
$js .= '$tabs.tabs( "option", "active", 0);';
|
2012-10-01 13:15:31 +02:00
|
|
|
break;
|
|
|
|
case "details":
|
2013-01-31 Miguel de Dios <miguel.dedios@artica.es>
* include/styles/jquery-ui-1.10.0.custom.css,
include/styles/images/ui-*,
include/javascript/jquery.jquery-ui-1.10.0.custom.js,
include/javascript/jquery-1.9.0.js: added the last version of
jquery and jqueryUI.
* godmode/reporting/visual_console_builder.editor.js,
include/ajax/events.php, include/functions_events.php,
include/functions_reporting.php,
include/javascript/pandora_events.js,
include/javascript/jquery.scrollTo.js,
include/javascript/jquery.tablesorter.pager.js,
include/javascript/jquery.tablesorter.js, include/functions_ui.php,
extensions/update_manager/lib/functions.php,
extensions/update_manager/main.php, extensions/agents_alerts.php,
operation/events/events.php, general/login_page.php,
general/logoff.php, general/header.php,
general/login_help_dialog.php: fixes about the new jquery and
jqueryUI version.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7554 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2013-01-31 17:49:08 +01:00
|
|
|
$js .= '$tabs.tabs( "option", "active", 1);';
|
2012-10-01 13:15:31 +02:00
|
|
|
break;
|
|
|
|
case "custom_fields":
|
2013-01-31 Miguel de Dios <miguel.dedios@artica.es>
* include/styles/jquery-ui-1.10.0.custom.css,
include/styles/images/ui-*,
include/javascript/jquery.jquery-ui-1.10.0.custom.js,
include/javascript/jquery-1.9.0.js: added the last version of
jquery and jqueryUI.
* godmode/reporting/visual_console_builder.editor.js,
include/ajax/events.php, include/functions_events.php,
include/functions_reporting.php,
include/javascript/pandora_events.js,
include/javascript/jquery.scrollTo.js,
include/javascript/jquery.tablesorter.pager.js,
include/javascript/jquery.tablesorter.js, include/functions_ui.php,
extensions/update_manager/lib/functions.php,
extensions/update_manager/main.php, extensions/agents_alerts.php,
operation/events/events.php, general/login_page.php,
general/logoff.php, general/header.php,
general/login_help_dialog.php: fixes about the new jquery and
jqueryUI version.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7554 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2013-01-31 17:49:08 +01:00
|
|
|
$js .= '$tabs.tabs( "option", "active", 2);';
|
2012-10-01 13:15:31 +02:00
|
|
|
break;
|
|
|
|
case "comments":
|
2013-01-31 Miguel de Dios <miguel.dedios@artica.es>
* include/styles/jquery-ui-1.10.0.custom.css,
include/styles/images/ui-*,
include/javascript/jquery.jquery-ui-1.10.0.custom.js,
include/javascript/jquery-1.9.0.js: added the last version of
jquery and jqueryUI.
* godmode/reporting/visual_console_builder.editor.js,
include/ajax/events.php, include/functions_events.php,
include/functions_reporting.php,
include/javascript/pandora_events.js,
include/javascript/jquery.scrollTo.js,
include/javascript/jquery.tablesorter.pager.js,
include/javascript/jquery.tablesorter.js, include/functions_ui.php,
extensions/update_manager/lib/functions.php,
extensions/update_manager/main.php, extensions/agents_alerts.php,
operation/events/events.php, general/login_page.php,
general/logoff.php, general/header.php,
general/login_help_dialog.php: fixes about the new jquery and
jqueryUI version.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7554 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2013-01-31 17:49:08 +01:00
|
|
|
$js .= '$tabs.tabs( "option", "active", 3);';
|
2012-10-01 13:15:31 +02:00
|
|
|
break;
|
2012-10-09 18:05:32 +02:00
|
|
|
case "responses":
|
2013-01-31 Miguel de Dios <miguel.dedios@artica.es>
* include/styles/jquery-ui-1.10.0.custom.css,
include/styles/images/ui-*,
include/javascript/jquery.jquery-ui-1.10.0.custom.js,
include/javascript/jquery-1.9.0.js: added the last version of
jquery and jqueryUI.
* godmode/reporting/visual_console_builder.editor.js,
include/ajax/events.php, include/functions_events.php,
include/functions_reporting.php,
include/javascript/pandora_events.js,
include/javascript/jquery.scrollTo.js,
include/javascript/jquery.tablesorter.pager.js,
include/javascript/jquery.tablesorter.js, include/functions_ui.php,
extensions/update_manager/lib/functions.php,
extensions/update_manager/main.php, extensions/agents_alerts.php,
operation/events/events.php, general/login_page.php,
general/logoff.php, general/header.php,
general/login_help_dialog.php: fixes about the new jquery and
jqueryUI version.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7554 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2013-01-31 17:49:08 +01:00
|
|
|
$js .= '$tabs.tabs( "option", "active", 4);';
|
2012-10-01 13:15:31 +02:00
|
|
|
break;
|
2013-09-09 18:21:45 +02:00
|
|
|
case "custom_data":
|
|
|
|
$js .= '$tabs.tabs( "option", "active", 5);';
|
|
|
|
break;
|
2012-10-01 13:15:31 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
$js .= '
|
|
|
|
});
|
|
|
|
</script>';
|
|
|
|
|
|
|
|
echo $out.$js;
|
|
|
|
}
|
|
|
|
|
2013-02-20 Miguel de Dios <miguel.dedios@artica.es>
* godmode/servers/recon_script.php, godmode/servers/plugin.php,
godmode/snmpconsole/snmp_filters.php,
godmode/massive/massive_delete_alerts.php,
godmode/massive/massive_enable_disable_alerts.php,
godmode/massive/massive_edit_agents.php,
godmode/massive/massive_delete_modules.php,
godmode/massive/massive_add_action_alerts.php,
godmode/massive/massive_delete_action_alerts.php: improved the code
style.
* include/ajax/events.php, include/functions_events.php,
operation/agentes/custom_fields.php: fixed the show admin custom
fields for user without permisitions.
Fixes: #3605278
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7683 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2013-02-20 13:07:00 +01:00
|
|
|
if ($get_events_details) {
|
2012-03-01 17:41:02 +01:00
|
|
|
$event_ids = explode(',',get_parameter ('event_ids'));
|
|
|
|
$events = db_get_all_rows_filter ('tevento',
|
|
|
|
array ('id_evento' => $event_ids,
|
|
|
|
'order' => 'utimestamp ASC'),
|
2013-06-06 15:54:39 +02:00
|
|
|
array ('evento', 'utimestamp', 'estado', 'criticity', 'id_usuario'));
|
2013-02-20 Miguel de Dios <miguel.dedios@artica.es>
* godmode/servers/recon_script.php, godmode/servers/plugin.php,
godmode/snmpconsole/snmp_filters.php,
godmode/massive/massive_delete_alerts.php,
godmode/massive/massive_enable_disable_alerts.php,
godmode/massive/massive_edit_agents.php,
godmode/massive/massive_delete_modules.php,
godmode/massive/massive_add_action_alerts.php,
godmode/massive/massive_delete_action_alerts.php: improved the code
style.
* include/ajax/events.php, include/functions_events.php,
operation/agentes/custom_fields.php: fixed the show admin custom
fields for user without permisitions.
Fixes: #3605278
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7683 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2013-02-20 13:07:00 +01:00
|
|
|
|
2012-03-01 17:41:02 +01:00
|
|
|
$out = '<table class="eventtable" style="width:100%;height:100%;padding:0px 0px 0px 0px; border-spacing: 0px; margin: 0px 0px 0px 0px;">';
|
|
|
|
$out .= '<tr style="font-size:0px; heigth: 0px; background: #ccc;"><td></td><td></td></tr>';
|
|
|
|
foreach($events as $event) {
|
|
|
|
switch($event["estado"]) {
|
|
|
|
case 0:
|
2013-03-08 14:12:37 +01:00
|
|
|
$img = ui_get_full_url("images/star.png", false, false, false);
|
2012-03-01 17:41:02 +01:00
|
|
|
$title = __('New event');
|
|
|
|
break;
|
|
|
|
case 1:
|
2013-03-08 14:12:37 +01:00
|
|
|
$img = ui_get_full_url("images/tick.png", false, false, false);
|
2012-03-01 17:41:02 +01:00
|
|
|
$title = __('Event validated');
|
|
|
|
break;
|
|
|
|
case 2:
|
2013-03-08 14:12:37 +01:00
|
|
|
$img = ui_get_full_url("images/hourglass.png", false, false, false);
|
2012-03-01 17:41:02 +01:00
|
|
|
$title = __('Event in process');
|
|
|
|
break;
|
|
|
|
}
|
2013-02-20 Miguel de Dios <miguel.dedios@artica.es>
* godmode/servers/recon_script.php, godmode/servers/plugin.php,
godmode/snmpconsole/snmp_filters.php,
godmode/massive/massive_delete_alerts.php,
godmode/massive/massive_enable_disable_alerts.php,
godmode/massive/massive_edit_agents.php,
godmode/massive/massive_delete_modules.php,
godmode/massive/massive_add_action_alerts.php,
godmode/massive/massive_delete_action_alerts.php: improved the code
style.
* include/ajax/events.php, include/functions_events.php,
operation/agentes/custom_fields.php: fixed the show admin custom
fields for user without permisitions.
Fixes: #3605278
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7683 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2013-02-20 13:07:00 +01:00
|
|
|
|
2013-03-08 14:12:37 +01:00
|
|
|
$out .= '<tr class="'.get_priority_class ($event['criticity']).'" style="height: 25px;">';
|
|
|
|
$out .= '<td class="'.get_priority_class ($event['criticity']).'" style="font-size:7pt" colspan=2>';
|
2012-03-01 17:41:02 +01:00
|
|
|
$out .= io_safe_output($event['evento']);
|
2013-03-08 14:12:37 +01:00
|
|
|
$out .= '</td></tr>';
|
|
|
|
|
|
|
|
$out .= '<tr class="'.get_priority_class ($event['criticity']).'" style="font-size:0px; height: 25px;">';
|
|
|
|
$out .= '<td class="'.get_priority_class ($event['criticity']).'" style="width: 18px; text-align:center;">';
|
|
|
|
$out .= html_print_image(ui_get_full_url('images/clock.png', false, false, false), true, array('title' => __('Timestamp')), false, true);
|
2013-07-16 11:09:50 +02:00
|
|
|
|
2013-03-08 14:12:37 +01:00
|
|
|
$out .= '</td>';
|
|
|
|
$out .= '<td class="'.get_priority_class ($event['criticity']).'" style="font-size:7pt">';
|
|
|
|
$out .= date($config['date_format'], $event['utimestamp']);
|
|
|
|
$out .= '</td></tr>';
|
|
|
|
|
|
|
|
$out .= '<tr class="'.get_priority_class ($event['criticity']).'" style="font-size:0px; height: 25px;">';
|
|
|
|
$out .= '<td class="'.get_priority_class ($event['criticity']).'" style="width: 18px; text-align:center;">';
|
|
|
|
$out .= html_print_image($img, true, array('title' => $title), false, true);
|
|
|
|
$out .= '</td>';
|
|
|
|
$out .= '<td class="'.get_priority_class ($event['criticity']).'" style="font-size:7pt">';
|
|
|
|
$out .= $title;
|
2013-07-16 11:09:50 +02:00
|
|
|
if ($event["estado"] == 1) {
|
|
|
|
if (empty($event['id_usuario'])) {
|
2013-03-08 14:12:37 +01:00
|
|
|
$ack_user = '<i>' . __('Auto') . '</i>';
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$ack_user = $event['id_usuario'];
|
|
|
|
}
|
|
|
|
|
|
|
|
$out .= ' (' . $ack_user . ')';
|
|
|
|
}
|
2013-07-16 11:09:50 +02:00
|
|
|
|
2013-03-08 14:12:37 +01:00
|
|
|
$out .= '</td></tr>';
|
|
|
|
|
|
|
|
$out .= '<tr style="font-size:0px; heigth: 0px; background: #999;"><td></td><td>';
|
2012-03-01 17:41:02 +01:00
|
|
|
$out .= '</td></tr><tr style="font-size:0px; heigth: 0px; background: #ccc;"><td></td><td>';
|
|
|
|
$out .= '</td></tr>';
|
|
|
|
}
|
|
|
|
$out .= '</table>';
|
|
|
|
|
|
|
|
echo $out;
|
|
|
|
}
|
|
|
|
?>
|