2019-01-30 16:18:44 +01:00
|
|
|
<?php
|
2020-08-31 12:48:00 +02:00
|
|
|
/**
|
|
|
|
* Alert actions
|
|
|
|
*
|
|
|
|
* @category Alerts
|
|
|
|
* @package Pandora FMS
|
|
|
|
* @subpackage Community
|
|
|
|
* @version 1.0.0
|
|
|
|
* @license See below
|
|
|
|
*
|
|
|
|
* ______ ___ _______ _______ ________
|
|
|
|
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
|
|
|
|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
|
|
|
|
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
|
|
|
*
|
|
|
|
* ============================================================================
|
2020-11-27 13:52:35 +01:00
|
|
|
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
|
2020-08-31 12:48:00 +02:00
|
|
|
* 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.
|
|
|
|
* ============================================================================
|
|
|
|
*/
|
|
|
|
|
|
|
|
// Load global vars.
|
2010-03-02 Sancho Lerena <slerena@artica.es>
* include/functions_reporting.php: Solved issue with several undefined
vars.
* include/functions_servers.php: Solved issue with several undefined
vars.
* include/functions_config.php: Added metaconsola witch to readconfig.
* include/config_process.php: Update build.. is YYMMDD !
* include/functions_ui.php: Removed deprecated call to split and replaced
by preg_split.
* index.php: Activated developer mode.
* operation/agentes/estado_monitores.php: Solved small problem with modules
without history, filling missing column in table. Added headers
* godmode/alerts/configure_alert_compound.php,
operation/agentes/status_monitor.php
godmode/alerts/configure_alert_template.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php,
godmode/alerts/alert_commands.php,
godmode/modules/manage_network_templates.php,
godmode/modules/module_list.php,
godmode/modules/manage_network_components.php,
godmode/modules/manage_nc_groups.php: Removed deprecated call to include
config.php and in some cases, added new header style.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2444 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-03-02 15:13:00 +01:00
|
|
|
global $config;
|
|
|
|
|
2019-01-30 16:18:44 +01:00
|
|
|
require_once $config['homedir'].'/include/functions_alerts.php';
|
|
|
|
require_once $config['homedir'].'/include/functions_users.php';
|
|
|
|
require_once $config['homedir'].'/include/functions_groups.php';
|
|
|
|
enterprise_include_once('meta/include/functions_alerts_meta.php');
|
2009-01-12 Esteban Sanchez <estebans@artica.es>
* godmode/agentes/alert_manager.php: Complete rewritten of the alert
system when assigned alerts to an agent.
* pandoradb.sql: New tables for alert system. These are:
talert_commands, talert_actions, talert_templates,
talert_template_modules, talert_template_module_actions. No migration
tool is available yet.
* godmode/alerts/configure_alert_template.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php: Added to repository. Administration
interface to new alert system.
* godmode/alerts/modify_alert.php: Deleted from repository.
* godmode/setup/setup.php: Added an example of the date format. Main
table has now percentage width.
* godmode/menu.php, operation/menu.php: Added new alert options.
Removed refr value when it's not neccesary.
* include/styles/pandora.css: Added width to textarea elements. Style
correction and cleanup. Tables doesn't have a odd-even pattern, but
the hovered row now changes its colour. New styles for alert pages.
* include/functions_custom_graphs.php: Added to repository. custom
graphs functions moved here.
* include/functions_incidents.php, include/functions_events.php: Moved
to LGPL. Style comment corrections.
* include/functions_html.php: Documentation style correction. Added
print_input_file() and print_label().
* include/functions_ui.php: Doc style correction.
* operation/reporting/graph_viewer.php: Include new function file with
custom graphs. Use generic functions.
* index.php: Unset pass from POST and REQUEST arrays.
* include/functions_db.php: Some documentation updated to new format.
Added format_array_to_update_sql() to generate SQL sentences for
updates. Style correction.
* godmode/agentes/configurar_agente.php: Variables renamed to have a
meaning.
* extensions/update_manager/main.php: Mark an string translatable.
* extensions/update_manager/lib/libupdate_manager_client.php,
godmode/alerts/configure_alert.php, include/functions.php,
godmode/agentes/module_manager.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
godmode/agentes/manage_config.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1331 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 15:31:01 +01:00
|
|
|
|
2019-01-30 16:18:44 +01:00
|
|
|
check_login();
|
2009-01-12 Esteban Sanchez <estebans@artica.es>
* godmode/agentes/alert_manager.php: Complete rewritten of the alert
system when assigned alerts to an agent.
* pandoradb.sql: New tables for alert system. These are:
talert_commands, talert_actions, talert_templates,
talert_template_modules, talert_template_module_actions. No migration
tool is available yet.
* godmode/alerts/configure_alert_template.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php: Added to repository. Administration
interface to new alert system.
* godmode/alerts/modify_alert.php: Deleted from repository.
* godmode/setup/setup.php: Added an example of the date format. Main
table has now percentage width.
* godmode/menu.php, operation/menu.php: Added new alert options.
Removed refr value when it's not neccesary.
* include/styles/pandora.css: Added width to textarea elements. Style
correction and cleanup. Tables doesn't have a odd-even pattern, but
the hovered row now changes its colour. New styles for alert pages.
* include/functions_custom_graphs.php: Added to repository. custom
graphs functions moved here.
* include/functions_incidents.php, include/functions_events.php: Moved
to LGPL. Style comment corrections.
* include/functions_html.php: Documentation style correction. Added
print_input_file() and print_label().
* include/functions_ui.php: Doc style correction.
* operation/reporting/graph_viewer.php: Include new function file with
custom graphs. Use generic functions.
* index.php: Unset pass from POST and REQUEST arrays.
* include/functions_db.php: Some documentation updated to new format.
Added format_array_to_update_sql() to generate SQL sentences for
updates. Style correction.
* godmode/agentes/configurar_agente.php: Variables renamed to have a
meaning.
* extensions/update_manager/main.php: Mark an string translatable.
* extensions/update_manager/lib/libupdate_manager_client.php,
godmode/alerts/configure_alert.php, include/functions.php,
godmode/agentes/module_manager.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
godmode/agentes/manage_config.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1331 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 15:31:01 +01:00
|
|
|
|
2021-03-11 15:40:23 +01:00
|
|
|
|
|
|
|
|
2015-03-06 12:28:05 +01:00
|
|
|
enterprise_hook('open_meta_frame');
|
|
|
|
|
2019-01-30 16:18:44 +01:00
|
|
|
if (! check_acl($config['id_user'], 0, 'LM')) {
|
|
|
|
db_pandora_audit(
|
2022-01-20 10:55:23 +01:00
|
|
|
AUDIT_LOG_ACL_VIOLATION,
|
2019-01-30 16:18:44 +01:00
|
|
|
'Trying to access Alert actions'
|
|
|
|
);
|
|
|
|
include 'general/noaccess.php';
|
|
|
|
exit;
|
2009-01-12 Esteban Sanchez <estebans@artica.es>
* godmode/agentes/alert_manager.php: Complete rewritten of the alert
system when assigned alerts to an agent.
* pandoradb.sql: New tables for alert system. These are:
talert_commands, talert_actions, talert_templates,
talert_template_modules, talert_template_module_actions. No migration
tool is available yet.
* godmode/alerts/configure_alert_template.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php: Added to repository. Administration
interface to new alert system.
* godmode/alerts/modify_alert.php: Deleted from repository.
* godmode/setup/setup.php: Added an example of the date format. Main
table has now percentage width.
* godmode/menu.php, operation/menu.php: Added new alert options.
Removed refr value when it's not neccesary.
* include/styles/pandora.css: Added width to textarea elements. Style
correction and cleanup. Tables doesn't have a odd-even pattern, but
the hovered row now changes its colour. New styles for alert pages.
* include/functions_custom_graphs.php: Added to repository. custom
graphs functions moved here.
* include/functions_incidents.php, include/functions_events.php: Moved
to LGPL. Style comment corrections.
* include/functions_html.php: Documentation style correction. Added
print_input_file() and print_label().
* include/functions_ui.php: Doc style correction.
* operation/reporting/graph_viewer.php: Include new function file with
custom graphs. Use generic functions.
* index.php: Unset pass from POST and REQUEST arrays.
* include/functions_db.php: Some documentation updated to new format.
Added format_array_to_update_sql() to generate SQL sentences for
updates. Style correction.
* godmode/agentes/configurar_agente.php: Variables renamed to have a
meaning.
* extensions/update_manager/main.php: Mark an string translatable.
* extensions/update_manager/lib/libupdate_manager_client.php,
godmode/alerts/configure_alert.php, include/functions.php,
godmode/agentes/module_manager.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
godmode/agentes/manage_config.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1331 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 15:31:01 +01:00
|
|
|
}
|
|
|
|
|
2019-01-30 16:18:44 +01:00
|
|
|
$update_action = (bool) get_parameter('update_action');
|
|
|
|
$create_action = (bool) get_parameter('create_action');
|
|
|
|
$delete_action = (bool) get_parameter('delete_action');
|
|
|
|
$copy_action = (bool) get_parameter('copy_action');
|
2012-12-12 20:37:35 +01:00
|
|
|
$pure = get_parameter('pure', 0);
|
2010-08-06 10:39:34 +02:00
|
|
|
|
2012-12-12 20:37:35 +01:00
|
|
|
if (defined('METACONSOLE')) {
|
2019-01-30 16:18:44 +01:00
|
|
|
$sec = 'advanced';
|
|
|
|
} else {
|
|
|
|
$sec = 'galertas';
|
2012-12-12 20:37:35 +01:00
|
|
|
}
|
|
|
|
|
2021-03-26 09:11:10 +01:00
|
|
|
$can_edit_all = false;
|
|
|
|
if (check_acl_restricted_all($config['id_user'], 0, 'LM')) {
|
|
|
|
$can_edit_all = true;
|
|
|
|
}
|
|
|
|
|
2019-11-28 11:51:32 +01:00
|
|
|
// Header.
|
|
|
|
if (defined('METACONSOLE')) {
|
|
|
|
alerts_meta_print_header();
|
|
|
|
} else {
|
2020-05-29 11:37:06 +02:00
|
|
|
ui_print_page_header(
|
|
|
|
__('Alerts').' » '.__('Alert actions'),
|
|
|
|
'images/gm_alerts.png',
|
|
|
|
false,
|
|
|
|
'',
|
|
|
|
true
|
|
|
|
);
|
2019-11-28 11:51:32 +01:00
|
|
|
}
|
2013-05-20 10:42:02 +02:00
|
|
|
|
2010-08-06 10:39:34 +02:00
|
|
|
if ($copy_action) {
|
2019-01-30 16:18:44 +01:00
|
|
|
$id = get_parameter('id');
|
|
|
|
|
|
|
|
$al_action = alerts_get_alert_action($id);
|
|
|
|
|
|
|
|
if ($al_action !== false) {
|
2021-03-26 09:11:10 +01:00
|
|
|
// If user who doesn't have permission to modify group all tries to copy an action with group=ALL.
|
|
|
|
if ($can_edit_all == false && $al_action['id_group'] == 0) {
|
|
|
|
$al_action['id_group'] = users_get_first_group(false, 'LM', false);
|
2020-08-31 12:48:00 +02:00
|
|
|
} else {
|
2019-01-30 16:18:44 +01:00
|
|
|
$own_info = get_user_info($config['id_user']);
|
2021-03-26 09:11:10 +01:00
|
|
|
if ($can_edit_all == true || check_acl($config['id_user'], 0, 'PM')) {
|
2020-08-31 12:48:00 +02:00
|
|
|
$own_groups = array_keys(
|
|
|
|
users_get_groups($config['id_user'], 'LM')
|
|
|
|
);
|
2019-01-30 16:18:44 +01:00
|
|
|
} else {
|
2020-08-31 12:48:00 +02:00
|
|
|
$own_groups = array_keys(
|
|
|
|
users_get_groups($config['id_user'], 'LM', false)
|
|
|
|
);
|
2019-01-30 16:18:44 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
$is_in_group = in_array($al_action['id_group'], $own_groups);
|
2020-08-31 12:48:00 +02:00
|
|
|
// Then action group have to be in his own groups.
|
2019-11-28 11:51:32 +01:00
|
|
|
if (!$is_in_group) {
|
2019-01-30 16:18:44 +01:00
|
|
|
db_pandora_audit(
|
2022-01-20 10:55:23 +01:00
|
|
|
AUDIT_LOG_ACL_VIOLATION,
|
2019-01-30 16:18:44 +01:00
|
|
|
'Trying to access Alert Management'
|
|
|
|
);
|
|
|
|
include 'general/noaccess.php';
|
|
|
|
exit;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-03-26 09:11:10 +01:00
|
|
|
$result = alerts_clone_alert_action($id, $al_action['id_group']);
|
2019-01-30 16:18:44 +01:00
|
|
|
|
2022-02-03 12:54:50 +01:00
|
|
|
$auditMessage = ((bool) $result === true)
|
|
|
|
? sprintf('Duplicate alert action %s clone to %s', $id, $result)
|
|
|
|
: sprintf('Fail try to duplicate alert action %s', $id);
|
|
|
|
|
|
|
|
db_pandora_audit(
|
|
|
|
AUDIT_LOG_ALERT_MANAGEMENT,
|
|
|
|
$auditMessage
|
|
|
|
);
|
2019-01-30 16:18:44 +01:00
|
|
|
|
|
|
|
ui_print_result_message(
|
|
|
|
$result,
|
|
|
|
__('Successfully copied'),
|
|
|
|
__('Could not be copied')
|
|
|
|
);
|
2010-08-06 10:39:34 +02:00
|
|
|
}
|
2009-01-12 Esteban Sanchez <estebans@artica.es>
* godmode/agentes/alert_manager.php: Complete rewritten of the alert
system when assigned alerts to an agent.
* pandoradb.sql: New tables for alert system. These are:
talert_commands, talert_actions, talert_templates,
talert_template_modules, talert_template_module_actions. No migration
tool is available yet.
* godmode/alerts/configure_alert_template.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php: Added to repository. Administration
interface to new alert system.
* godmode/alerts/modify_alert.php: Deleted from repository.
* godmode/setup/setup.php: Added an example of the date format. Main
table has now percentage width.
* godmode/menu.php, operation/menu.php: Added new alert options.
Removed refr value when it's not neccesary.
* include/styles/pandora.css: Added width to textarea elements. Style
correction and cleanup. Tables doesn't have a odd-even pattern, but
the hovered row now changes its colour. New styles for alert pages.
* include/functions_custom_graphs.php: Added to repository. custom
graphs functions moved here.
* include/functions_incidents.php, include/functions_events.php: Moved
to LGPL. Style comment corrections.
* include/functions_html.php: Documentation style correction. Added
print_input_file() and print_label().
* include/functions_ui.php: Doc style correction.
* operation/reporting/graph_viewer.php: Include new function file with
custom graphs. Use generic functions.
* index.php: Unset pass from POST and REQUEST arrays.
* include/functions_db.php: Some documentation updated to new format.
Added format_array_to_update_sql() to generate SQL sentences for
updates. Style correction.
* godmode/agentes/configurar_agente.php: Variables renamed to have a
meaning.
* extensions/update_manager/main.php: Mark an string translatable.
* extensions/update_manager/lib/libupdate_manager_client.php,
godmode/alerts/configure_alert.php, include/functions.php,
godmode/agentes/module_manager.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
godmode/agentes/manage_config.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1331 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 15:31:01 +01:00
|
|
|
|
2018-10-22 16:19:29 +02:00
|
|
|
if ($update_action || $create_action) {
|
2019-01-30 16:18:44 +01:00
|
|
|
alerts_ui_update_or_create_actions($update_action);
|
2009-01-12 Esteban Sanchez <estebans@artica.es>
* godmode/agentes/alert_manager.php: Complete rewritten of the alert
system when assigned alerts to an agent.
* pandoradb.sql: New tables for alert system. These are:
talert_commands, talert_actions, talert_templates,
talert_template_modules, talert_template_module_actions. No migration
tool is available yet.
* godmode/alerts/configure_alert_template.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php: Added to repository. Administration
interface to new alert system.
* godmode/alerts/modify_alert.php: Deleted from repository.
* godmode/setup/setup.php: Added an example of the date format. Main
table has now percentage width.
* godmode/menu.php, operation/menu.php: Added new alert options.
Removed refr value when it's not neccesary.
* include/styles/pandora.css: Added width to textarea elements. Style
correction and cleanup. Tables doesn't have a odd-even pattern, but
the hovered row now changes its colour. New styles for alert pages.
* include/functions_custom_graphs.php: Added to repository. custom
graphs functions moved here.
* include/functions_incidents.php, include/functions_events.php: Moved
to LGPL. Style comment corrections.
* include/functions_html.php: Documentation style correction. Added
print_input_file() and print_label().
* include/functions_ui.php: Doc style correction.
* operation/reporting/graph_viewer.php: Include new function file with
custom graphs. Use generic functions.
* index.php: Unset pass from POST and REQUEST arrays.
* include/functions_db.php: Some documentation updated to new format.
Added format_array_to_update_sql() to generate SQL sentences for
updates. Style correction.
* godmode/agentes/configurar_agente.php: Variables renamed to have a
meaning.
* extensions/update_manager/main.php: Mark an string translatable.
* extensions/update_manager/lib/libupdate_manager_client.php,
godmode/alerts/configure_alert.php, include/functions.php,
godmode/agentes/module_manager.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
godmode/agentes/manage_config.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1331 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 15:31:01 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
if ($delete_action) {
|
2019-01-30 16:18:44 +01:00
|
|
|
$id = get_parameter('id');
|
|
|
|
|
|
|
|
$al_action = alerts_get_alert_action($id);
|
|
|
|
|
2020-10-22 12:00:44 +02:00
|
|
|
if (!check_acl_restricted_all($config['id_user'], $al_action['id_group'], 'LM')) {
|
|
|
|
db_pandora_audit(
|
2022-01-20 10:55:23 +01:00
|
|
|
AUDIT_LOG_ACL_VIOLATION,
|
2020-10-22 12:00:44 +02:00
|
|
|
'Trying to access Alert Management'
|
|
|
|
);
|
|
|
|
include 'general/noaccess.php';
|
|
|
|
exit;
|
|
|
|
}
|
|
|
|
|
2019-01-30 16:18:44 +01:00
|
|
|
if ($al_action !== false) {
|
2020-08-31 12:48:00 +02:00
|
|
|
// If user tries to delete an action with group=ALL.
|
2019-01-30 16:18:44 +01:00
|
|
|
if ($al_action['id_group'] == 0) {
|
2020-08-31 12:48:00 +02:00
|
|
|
// Then must have "PM" access privileges.
|
2019-01-30 16:18:44 +01:00
|
|
|
if (! check_acl($config['id_user'], 0, 'PM')) {
|
|
|
|
db_pandora_audit(
|
2022-01-20 10:55:23 +01:00
|
|
|
AUDIT_LOG_ACL_VIOLATION,
|
2019-01-30 16:18:44 +01:00
|
|
|
'Trying to access Alert Management'
|
|
|
|
);
|
|
|
|
include 'general/noaccess.php';
|
|
|
|
exit;
|
|
|
|
}
|
|
|
|
|
2020-08-31 12:48:00 +02:00
|
|
|
// If user tries to delete an action of others groups.
|
2019-01-30 16:18:44 +01:00
|
|
|
} else {
|
|
|
|
$own_info = get_user_info($config['id_user']);
|
|
|
|
if ($own_info['is_admin'] || check_acl($config['id_user'], 0, 'PM')) {
|
2020-08-31 12:48:00 +02:00
|
|
|
$own_groups = array_keys(
|
|
|
|
users_get_groups($config['id_user'], 'LM')
|
|
|
|
);
|
2019-01-30 16:18:44 +01:00
|
|
|
} else {
|
2020-08-31 12:48:00 +02:00
|
|
|
$own_groups = array_keys(
|
|
|
|
users_get_groups($config['id_user'], 'LM', false)
|
|
|
|
);
|
2019-01-30 16:18:44 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
$is_in_group = in_array($al_action['id_group'], $own_groups);
|
2020-08-31 12:48:00 +02:00
|
|
|
// Then action group have to be in his own groups.
|
2019-11-28 11:51:32 +01:00
|
|
|
if (!$is_in_group) {
|
2019-01-30 16:18:44 +01:00
|
|
|
db_pandora_audit(
|
2022-01-20 10:55:23 +01:00
|
|
|
AUDIT_LOG_ACL_VIOLATION,
|
2019-01-30 16:18:44 +01:00
|
|
|
'Trying to access Alert Management'
|
|
|
|
);
|
|
|
|
include 'general/noaccess.php';
|
|
|
|
exit;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$result = alerts_delete_alert_action($id);
|
|
|
|
|
2022-02-03 12:54:50 +01:00
|
|
|
$auditMessage = ((bool) $result === true)
|
|
|
|
? sprintf('Delete alert action #%s', $id)
|
|
|
|
: sprintf('Fail try to delete alert action #%s', $id);
|
|
|
|
|
|
|
|
db_pandora_audit(
|
|
|
|
AUDIT_LOG_ALERT_MANAGEMENT,
|
|
|
|
$auditMessage
|
|
|
|
);
|
2019-01-30 16:18:44 +01:00
|
|
|
|
|
|
|
ui_print_result_message(
|
|
|
|
$result,
|
|
|
|
__('Successfully deleted'),
|
|
|
|
__('Could not be deleted')
|
|
|
|
);
|
2009-01-12 Esteban Sanchez <estebans@artica.es>
* godmode/agentes/alert_manager.php: Complete rewritten of the alert
system when assigned alerts to an agent.
* pandoradb.sql: New tables for alert system. These are:
talert_commands, talert_actions, talert_templates,
talert_template_modules, talert_template_module_actions. No migration
tool is available yet.
* godmode/alerts/configure_alert_template.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php: Added to repository. Administration
interface to new alert system.
* godmode/alerts/modify_alert.php: Deleted from repository.
* godmode/setup/setup.php: Added an example of the date format. Main
table has now percentage width.
* godmode/menu.php, operation/menu.php: Added new alert options.
Removed refr value when it's not neccesary.
* include/styles/pandora.css: Added width to textarea elements. Style
correction and cleanup. Tables doesn't have a odd-even pattern, but
the hovered row now changes its colour. New styles for alert pages.
* include/functions_custom_graphs.php: Added to repository. custom
graphs functions moved here.
* include/functions_incidents.php, include/functions_events.php: Moved
to LGPL. Style comment corrections.
* include/functions_html.php: Documentation style correction. Added
print_input_file() and print_label().
* include/functions_ui.php: Doc style correction.
* operation/reporting/graph_viewer.php: Include new function file with
custom graphs. Use generic functions.
* index.php: Unset pass from POST and REQUEST arrays.
* include/functions_db.php: Some documentation updated to new format.
Added format_array_to_update_sql() to generate SQL sentences for
updates. Style correction.
* godmode/agentes/configurar_agente.php: Variables renamed to have a
meaning.
* extensions/update_manager/main.php: Mark an string translatable.
* extensions/update_manager/lib/libupdate_manager_client.php,
godmode/alerts/configure_alert.php, include/functions.php,
godmode/agentes/module_manager.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
godmode/agentes/manage_config.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1331 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 15:31:01 +01:00
|
|
|
}
|
|
|
|
|
2021-06-03 10:16:29 +02:00
|
|
|
$is_management_allowed = is_management_allowed();
|
|
|
|
if ($is_management_allowed === false) {
|
2021-09-23 11:16:48 +02:00
|
|
|
if (is_metaconsole() === false) {
|
|
|
|
$url = '<a target="_blank" href="'.ui_get_meta_url(
|
|
|
|
'index.php?sec=advanced&sec2=godmode/alerts/alert_actions&tab=action&pure=0'
|
|
|
|
).'">'.__('metaconsole').'</a>';
|
|
|
|
} else {
|
|
|
|
$url = __('any node');
|
|
|
|
}
|
|
|
|
|
2020-07-13 12:23:46 +02:00
|
|
|
ui_print_warning_message(
|
2021-06-24 19:48:07 +02:00
|
|
|
__(
|
|
|
|
'This node is configured with centralized mode. All alert actions information is read only. Go to %s to manage it.',
|
2021-09-23 11:16:48 +02:00
|
|
|
$url
|
2021-06-24 19:48:07 +02:00
|
|
|
)
|
2020-07-13 12:23:46 +02:00
|
|
|
);
|
|
|
|
}
|
2020-03-02 16:17:45 +01:00
|
|
|
|
|
|
|
$search_string = (string) get_parameter('search_string', '');
|
|
|
|
$group = (int) get_parameter('group', 0);
|
2020-08-31 12:48:00 +02:00
|
|
|
$group_search = (int) get_parameter('group_search', 0);
|
|
|
|
$id_command_search = (int) get_parameter('id_command_search', 0);
|
2021-11-24 15:27:53 +01:00
|
|
|
$url = 'index.php?sec='.$sec.'&sec2=godmode/alerts/alert_actions&search_string='.$search_string.'&group_search='.$group_search.'&id_command_search='.$id_command_search;
|
2020-03-02 16:17:45 +01:00
|
|
|
|
|
|
|
// Filter table.
|
|
|
|
$table_filter = new stdClass();
|
|
|
|
$table_filter->width = '100%';
|
|
|
|
$table_filter->class = 'databox filters';
|
|
|
|
$table_filter->style = [];
|
|
|
|
$table_filter->style[0] = 'font-weight: bold';
|
|
|
|
$table_filter->style[2] = 'font-weight: bold';
|
2020-08-31 12:48:00 +02:00
|
|
|
$table_filter->style[4] = 'font-weight: bold';
|
2020-03-02 16:17:45 +01:00
|
|
|
$table_filter->data = [];
|
|
|
|
|
|
|
|
$table_filter->data[0][0] = __('Search');
|
|
|
|
$table_filter->data[0][1] = html_print_input_text(
|
|
|
|
'search_string',
|
|
|
|
$search_string,
|
|
|
|
'',
|
|
|
|
25,
|
|
|
|
255,
|
|
|
|
true
|
|
|
|
);
|
2020-10-22 12:00:44 +02:00
|
|
|
|
|
|
|
$return_all_group = false;
|
|
|
|
|
|
|
|
if (users_can_manage_group_all('LM') === true) {
|
|
|
|
$return_all_group = true;
|
|
|
|
}
|
|
|
|
|
2020-03-02 16:17:45 +01:00
|
|
|
$table_filter->data[0][2] = __('Group');
|
2020-08-31 12:48:00 +02:00
|
|
|
$table_filter->data[0][3] = html_print_select_groups(
|
|
|
|
$config['id_user'],
|
|
|
|
'LM',
|
2020-10-22 12:00:44 +02:00
|
|
|
$return_all_group,
|
2020-08-31 12:48:00 +02:00
|
|
|
'group_search',
|
|
|
|
$group_search,
|
|
|
|
'',
|
|
|
|
'',
|
|
|
|
0,
|
|
|
|
true
|
|
|
|
);
|
|
|
|
$table_filter->data[0][4] = __('Command');
|
|
|
|
$commands_sql = db_get_all_rows_filter(
|
|
|
|
'talert_commands',
|
|
|
|
['id_group' => array_keys(users_get_groups(false, 'LW'))],
|
|
|
|
[
|
|
|
|
'id',
|
|
|
|
'name',
|
|
|
|
],
|
|
|
|
'AND',
|
|
|
|
false,
|
|
|
|
true
|
|
|
|
);
|
|
|
|
|
|
|
|
$commands = db_get_all_rows_sql($commands_sql);
|
|
|
|
$table_filter->data[0][5] = html_print_select(
|
|
|
|
index_array($commands, 'id', 'name'),
|
|
|
|
'id_command_search',
|
|
|
|
$id_command_search,
|
|
|
|
'',
|
|
|
|
__('None'),
|
|
|
|
0,
|
|
|
|
true,
|
|
|
|
false,
|
|
|
|
true,
|
|
|
|
'',
|
|
|
|
false,
|
|
|
|
'width:150px'
|
|
|
|
);
|
|
|
|
$table_filter->data[0][6] = '<div class="action-buttons">';
|
|
|
|
$table_filter->data[0][6] .= html_print_submit_button(
|
2020-03-02 16:17:45 +01:00
|
|
|
__('Search'),
|
|
|
|
'',
|
|
|
|
false,
|
|
|
|
'class="sub search"',
|
|
|
|
true
|
|
|
|
);
|
2020-08-31 12:48:00 +02:00
|
|
|
$table_filter->data[0][5] .= '</div>';
|
2020-03-02 16:17:45 +01:00
|
|
|
|
|
|
|
|
|
|
|
$show_table_filter = '<form method="post" action="'.$url.'">';
|
|
|
|
$show_table_filter .= html_print_table($table_filter, true);
|
|
|
|
$show_table_filter .= '</form>';
|
|
|
|
if (is_metaconsole()) {
|
|
|
|
ui_toggle($show_table_filter, __('Show Options'));
|
|
|
|
} else {
|
|
|
|
echo $show_table_filter;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2018-11-21 15:16:52 +01:00
|
|
|
$table = new stdClass();
|
2015-06-16 16:09:50 +02:00
|
|
|
$table->width = '100%';
|
2019-03-29 11:05:52 +01:00
|
|
|
$table->class = 'info_table';
|
2019-01-30 16:18:44 +01:00
|
|
|
$table->data = [];
|
|
|
|
$table->head = [];
|
2009-01-12 Esteban Sanchez <estebans@artica.es>
* godmode/agentes/alert_manager.php: Complete rewritten of the alert
system when assigned alerts to an agent.
* pandoradb.sql: New tables for alert system. These are:
talert_commands, talert_actions, talert_templates,
talert_template_modules, talert_template_module_actions. No migration
tool is available yet.
* godmode/alerts/configure_alert_template.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php: Added to repository. Administration
interface to new alert system.
* godmode/alerts/modify_alert.php: Deleted from repository.
* godmode/setup/setup.php: Added an example of the date format. Main
table has now percentage width.
* godmode/menu.php, operation/menu.php: Added new alert options.
Removed refr value when it's not neccesary.
* include/styles/pandora.css: Added width to textarea elements. Style
correction and cleanup. Tables doesn't have a odd-even pattern, but
the hovered row now changes its colour. New styles for alert pages.
* include/functions_custom_graphs.php: Added to repository. custom
graphs functions moved here.
* include/functions_incidents.php, include/functions_events.php: Moved
to LGPL. Style comment corrections.
* include/functions_html.php: Documentation style correction. Added
print_input_file() and print_label().
* include/functions_ui.php: Doc style correction.
* operation/reporting/graph_viewer.php: Include new function file with
custom graphs. Use generic functions.
* index.php: Unset pass from POST and REQUEST arrays.
* include/functions_db.php: Some documentation updated to new format.
Added format_array_to_update_sql() to generate SQL sentences for
updates. Style correction.
* godmode/agentes/configurar_agente.php: Variables renamed to have a
meaning.
* extensions/update_manager/main.php: Mark an string translatable.
* extensions/update_manager/lib/libupdate_manager_client.php,
godmode/alerts/configure_alert.php, include/functions.php,
godmode/agentes/module_manager.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
godmode/agentes/manage_config.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1331 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 15:31:01 +01:00
|
|
|
$table->head[0] = __('Name');
|
2020-08-31 12:48:00 +02:00
|
|
|
$table->head[1] = __('Command');
|
|
|
|
$table->head[2] = __('Group');
|
2021-06-03 10:16:29 +02:00
|
|
|
if (is_management_allowed() === true) {
|
2020-08-31 12:48:00 +02:00
|
|
|
$table->head[3] = __('Copy');
|
|
|
|
$table->head[4] = __('Delete');
|
2020-07-13 12:23:46 +02:00
|
|
|
}
|
|
|
|
|
2019-01-30 16:18:44 +01:00
|
|
|
$table->style = [];
|
2009-01-12 Esteban Sanchez <estebans@artica.es>
* godmode/agentes/alert_manager.php: Complete rewritten of the alert
system when assigned alerts to an agent.
* pandoradb.sql: New tables for alert system. These are:
talert_commands, talert_actions, talert_templates,
talert_template_modules, talert_template_module_actions. No migration
tool is available yet.
* godmode/alerts/configure_alert_template.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php: Added to repository. Administration
interface to new alert system.
* godmode/alerts/modify_alert.php: Deleted from repository.
* godmode/setup/setup.php: Added an example of the date format. Main
table has now percentage width.
* godmode/menu.php, operation/menu.php: Added new alert options.
Removed refr value when it's not neccesary.
* include/styles/pandora.css: Added width to textarea elements. Style
correction and cleanup. Tables doesn't have a odd-even pattern, but
the hovered row now changes its colour. New styles for alert pages.
* include/functions_custom_graphs.php: Added to repository. custom
graphs functions moved here.
* include/functions_incidents.php, include/functions_events.php: Moved
to LGPL. Style comment corrections.
* include/functions_html.php: Documentation style correction. Added
print_input_file() and print_label().
* include/functions_ui.php: Doc style correction.
* operation/reporting/graph_viewer.php: Include new function file with
custom graphs. Use generic functions.
* index.php: Unset pass from POST and REQUEST arrays.
* include/functions_db.php: Some documentation updated to new format.
Added format_array_to_update_sql() to generate SQL sentences for
updates. Style correction.
* godmode/agentes/configurar_agente.php: Variables renamed to have a
meaning.
* extensions/update_manager/main.php: Mark an string translatable.
* extensions/update_manager/lib/libupdate_manager_client.php,
godmode/alerts/configure_alert.php, include/functions.php,
godmode/agentes/module_manager.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
godmode/agentes/manage_config.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1331 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 15:31:01 +01:00
|
|
|
$table->style[0] = 'font-weight: bold';
|
2019-01-30 16:18:44 +01:00
|
|
|
$table->size = [];
|
2010-08-06 10:39:34 +02:00
|
|
|
$table->size[3] = '40px';
|
2020-08-31 12:48:00 +02:00
|
|
|
$table->size[4] = '40px';
|
2019-01-30 16:18:44 +01:00
|
|
|
$table->align = [];
|
2015-06-16 16:09:50 +02:00
|
|
|
$table->align[1] = 'left';
|
|
|
|
$table->align[2] = 'left';
|
|
|
|
$table->align[3] = 'left';
|
2020-08-31 12:48:00 +02:00
|
|
|
$table->align[4] = 'left';
|
2009-01-12 Esteban Sanchez <estebans@artica.es>
* godmode/agentes/alert_manager.php: Complete rewritten of the alert
system when assigned alerts to an agent.
* pandoradb.sql: New tables for alert system. These are:
talert_commands, talert_actions, talert_templates,
talert_template_modules, talert_template_module_actions. No migration
tool is available yet.
* godmode/alerts/configure_alert_template.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php: Added to repository. Administration
interface to new alert system.
* godmode/alerts/modify_alert.php: Deleted from repository.
* godmode/setup/setup.php: Added an example of the date format. Main
table has now percentage width.
* godmode/menu.php, operation/menu.php: Added new alert options.
Removed refr value when it's not neccesary.
* include/styles/pandora.css: Added width to textarea elements. Style
correction and cleanup. Tables doesn't have a odd-even pattern, but
the hovered row now changes its colour. New styles for alert pages.
* include/functions_custom_graphs.php: Added to repository. custom
graphs functions moved here.
* include/functions_incidents.php, include/functions_events.php: Moved
to LGPL. Style comment corrections.
* include/functions_html.php: Documentation style correction. Added
print_input_file() and print_label().
* include/functions_ui.php: Doc style correction.
* operation/reporting/graph_viewer.php: Include new function file with
custom graphs. Use generic functions.
* index.php: Unset pass from POST and REQUEST arrays.
* include/functions_db.php: Some documentation updated to new format.
Added format_array_to_update_sql() to generate SQL sentences for
updates. Style correction.
* godmode/agentes/configurar_agente.php: Variables renamed to have a
meaning.
* extensions/update_manager/main.php: Mark an string translatable.
* extensions/update_manager/lib/libupdate_manager_client.php,
godmode/alerts/configure_alert.php, include/functions.php,
godmode/agentes/module_manager.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
godmode/agentes/manage_config.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1331 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 15:31:01 +01:00
|
|
|
|
2019-01-30 16:18:44 +01:00
|
|
|
$filter = [];
|
2021-07-13 02:53:23 +02:00
|
|
|
if (!is_user_admin($config['id_user'])) {
|
2020-08-31 12:48:00 +02:00
|
|
|
$filter['talert_actions.id_group'] = array_keys(
|
|
|
|
users_get_groups(false, 'LM')
|
|
|
|
);
|
2019-01-30 16:18:44 +01:00
|
|
|
}
|
2013-04-03 06:28:24 +02:00
|
|
|
|
2020-08-31 12:48:00 +02:00
|
|
|
if ($group_search !== 0) {
|
|
|
|
$filter['talert_actions.id_group'] = $group_search;
|
2020-03-02 16:17:45 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
if ($search_string !== '') {
|
|
|
|
$filter['talert_actions.name'] = '%'.$search_string.'%';
|
|
|
|
}
|
|
|
|
|
2020-08-31 12:48:00 +02:00
|
|
|
if ($id_command_search !== 0) {
|
|
|
|
$filter['talert_commands.id'] = $id_command_search;
|
|
|
|
}
|
|
|
|
|
2019-01-30 16:18:44 +01:00
|
|
|
$actions = db_get_all_rows_filter(
|
|
|
|
'talert_actions INNER JOIN talert_commands ON talert_actions.id_alert_command = talert_commands.id',
|
|
|
|
$filter,
|
2020-08-31 12:48:00 +02:00
|
|
|
'talert_actions.* , talert_commands.id_group AS command_group, talert_commands.name AS command_name'
|
2018-10-22 16:48:24 +02:00
|
|
|
);
|
2020-08-31 12:48:00 +02:00
|
|
|
|
2019-01-30 16:18:44 +01:00
|
|
|
if ($actions === false) {
|
|
|
|
$actions = [];
|
|
|
|
}
|
2009-01-12 Esteban Sanchez <estebans@artica.es>
* godmode/agentes/alert_manager.php: Complete rewritten of the alert
system when assigned alerts to an agent.
* pandoradb.sql: New tables for alert system. These are:
talert_commands, talert_actions, talert_templates,
talert_template_modules, talert_template_module_actions. No migration
tool is available yet.
* godmode/alerts/configure_alert_template.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php: Added to repository. Administration
interface to new alert system.
* godmode/alerts/modify_alert.php: Deleted from repository.
* godmode/setup/setup.php: Added an example of the date format. Main
table has now percentage width.
* godmode/menu.php, operation/menu.php: Added new alert options.
Removed refr value when it's not neccesary.
* include/styles/pandora.css: Added width to textarea elements. Style
correction and cleanup. Tables doesn't have a odd-even pattern, but
the hovered row now changes its colour. New styles for alert pages.
* include/functions_custom_graphs.php: Added to repository. custom
graphs functions moved here.
* include/functions_incidents.php, include/functions_events.php: Moved
to LGPL. Style comment corrections.
* include/functions_html.php: Documentation style correction. Added
print_input_file() and print_label().
* include/functions_ui.php: Doc style correction.
* operation/reporting/graph_viewer.php: Include new function file with
custom graphs. Use generic functions.
* index.php: Unset pass from POST and REQUEST arrays.
* include/functions_db.php: Some documentation updated to new format.
Added format_array_to_update_sql() to generate SQL sentences for
updates. Style correction.
* godmode/agentes/configurar_agente.php: Variables renamed to have a
meaning.
* extensions/update_manager/main.php: Mark an string translatable.
* extensions/update_manager/lib/libupdate_manager_client.php,
godmode/alerts/configure_alert.php, include/functions.php,
godmode/agentes/module_manager.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
godmode/agentes/manage_config.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1331 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 15:31:01 +01:00
|
|
|
|
2020-03-02 16:17:45 +01:00
|
|
|
// Pagination.
|
|
|
|
$total_actions = count($actions);
|
|
|
|
$offset = (int) get_parameter('offset');
|
|
|
|
$limit = (int) $config['block_size'];
|
|
|
|
$actions = array_slice($actions, $offset, $limit);
|
|
|
|
|
2009-08-07 Miguel de Dios <miguel.dedios@artica.es>
* operation/visual_console/index.php,
pandora_console/operation/users/user.php, operation/incidents/incident.php,
operation/agentes/status_monitor.php, operation/agentes/estado_agente.php,
operation/agentes/alerts_status.php, include/styles/pandora.css,
include/styles/pandora_black.css,include/styles/pandora_blackmetal.css,
include/styles/pandora_width.css, include/styles/pandora_minimal.css,
include/styles/pandora_red.css: the table list now has rows with alternate
colours for easy see the data.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1833 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-08-10 11:55:53 +02:00
|
|
|
$rowPair = true;
|
|
|
|
$iterator = 0;
|
2009-01-12 Esteban Sanchez <estebans@artica.es>
* godmode/agentes/alert_manager.php: Complete rewritten of the alert
system when assigned alerts to an agent.
* pandoradb.sql: New tables for alert system. These are:
talert_commands, talert_actions, talert_templates,
talert_template_modules, talert_template_module_actions. No migration
tool is available yet.
* godmode/alerts/configure_alert_template.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php: Added to repository. Administration
interface to new alert system.
* godmode/alerts/modify_alert.php: Deleted from repository.
* godmode/setup/setup.php: Added an example of the date format. Main
table has now percentage width.
* godmode/menu.php, operation/menu.php: Added new alert options.
Removed refr value when it's not neccesary.
* include/styles/pandora.css: Added width to textarea elements. Style
correction and cleanup. Tables doesn't have a odd-even pattern, but
the hovered row now changes its colour. New styles for alert pages.
* include/functions_custom_graphs.php: Added to repository. custom
graphs functions moved here.
* include/functions_incidents.php, include/functions_events.php: Moved
to LGPL. Style comment corrections.
* include/functions_html.php: Documentation style correction. Added
print_input_file() and print_label().
* include/functions_ui.php: Doc style correction.
* operation/reporting/graph_viewer.php: Include new function file with
custom graphs. Use generic functions.
* index.php: Unset pass from POST and REQUEST arrays.
* include/functions_db.php: Some documentation updated to new format.
Added format_array_to_update_sql() to generate SQL sentences for
updates. Style correction.
* godmode/agentes/configurar_agente.php: Variables renamed to have a
meaning.
* extensions/update_manager/main.php: Mark an string translatable.
* extensions/update_manager/lib/libupdate_manager_client.php,
godmode/alerts/configure_alert.php, include/functions.php,
godmode/agentes/module_manager.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
godmode/agentes/manage_config.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1331 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 15:31:01 +01:00
|
|
|
foreach ($actions as $action) {
|
2019-01-30 16:18:44 +01:00
|
|
|
if ($rowPair) {
|
|
|
|
$table->rowclass[$iterator] = 'rowPair';
|
|
|
|
} else {
|
|
|
|
$table->rowclass[$iterator] = 'rowOdd';
|
|
|
|
}
|
|
|
|
|
|
|
|
$rowPair = !$rowPair;
|
|
|
|
$iterator++;
|
|
|
|
|
|
|
|
$data = [];
|
|
|
|
|
2021-03-26 09:11:10 +01:00
|
|
|
$data[0] = '<a href="index.php?sec='.$sec.'&sec2=godmode/alerts/configure_alert_action&id='.$action['id'].'&pure='.$pure.'">'.$action['name'].'</a>';
|
|
|
|
if ($action['id_group'] == 0 && $can_edit_all == false) {
|
|
|
|
$data[0] .= ui_print_help_tip(__('You cannot edit this action, You don\'t have the permission to edit All group.'), true);
|
2020-10-22 12:00:44 +02:00
|
|
|
}
|
|
|
|
|
2020-08-31 12:48:00 +02:00
|
|
|
$data[1] = $action['command_name'];
|
|
|
|
$data[2] = ui_print_group_icon($action['id_group'], true).' ';
|
2019-01-30 16:18:44 +01:00
|
|
|
if (!alerts_validate_command_to_action($action['id_group'], $action['command_group'])) {
|
2020-08-31 12:48:00 +02:00
|
|
|
$data[2] .= html_print_image(
|
2019-01-30 16:18:44 +01:00
|
|
|
'images/error.png',
|
|
|
|
true,
|
|
|
|
// FIXME: Translation.
|
|
|
|
[
|
|
|
|
'title' => __('The action and the command associated with it do not have the same group. Please contact an administrator to fix it.'),
|
|
|
|
]
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2020-10-22 12:00:44 +02:00
|
|
|
$data[3] = '';
|
|
|
|
$data[4] = '';
|
|
|
|
|
2021-06-03 10:16:29 +02:00
|
|
|
if (is_management_allowed() === true
|
2021-03-26 09:11:10 +01:00
|
|
|
&& check_acl($config['id_user'], $action['id_group'], 'LM')
|
2020-07-13 12:23:46 +02:00
|
|
|
) {
|
2019-04-02 13:42:30 +02:00
|
|
|
$table->cellclass[] = [
|
|
|
|
3 => 'action_buttons',
|
2020-08-31 12:48:00 +02:00
|
|
|
4 => 'action_buttons',
|
2019-04-02 13:42:30 +02:00
|
|
|
];
|
2019-11-28 11:51:32 +01:00
|
|
|
|
|
|
|
$id_action = $action['id'];
|
|
|
|
$text_confirm = __('Are you sure?');
|
|
|
|
|
2021-03-26 09:11:10 +01:00
|
|
|
$data[3] = '<form method="post" style="display: inline; float: right" onsubmit="if (!confirm(\''.$text_confirm.'\')) return false;">';
|
|
|
|
$data[3] .= html_print_input_hidden('copy_action', 1, true);
|
|
|
|
$data[3] .= html_print_input_hidden('id', $id_action, true);
|
|
|
|
$data[3] .= html_print_input_image(
|
|
|
|
'dup',
|
|
|
|
'images/copy.png',
|
|
|
|
1,
|
|
|
|
'',
|
|
|
|
true,
|
|
|
|
['title' => __('Duplicate')]
|
|
|
|
);
|
|
|
|
$data[3] .= '</form> ';
|
|
|
|
|
|
|
|
if ($action['id_group'] != 0 || $can_edit_all == true) {
|
|
|
|
$data[4] = '<form method="post" style="display: inline; float: right" onsubmit="if (!confirm(\''.$text_confirm.'\')) return false;">';
|
|
|
|
$data[4] .= html_print_input_hidden('delete_action', 1, true);
|
|
|
|
$data[4] .= html_print_input_hidden('id', $id_action, true);
|
|
|
|
$data[4] .= html_print_input_image(
|
|
|
|
'del',
|
|
|
|
'images/cross.png',
|
|
|
|
1,
|
|
|
|
'',
|
|
|
|
true,
|
|
|
|
['title' => __('Delete')]
|
|
|
|
);
|
|
|
|
$data[4] .= '</form> ';
|
|
|
|
} else {
|
|
|
|
$data[4] = '';
|
|
|
|
}
|
2019-01-30 16:18:44 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
array_push($table->data, $data);
|
2009-01-12 Esteban Sanchez <estebans@artica.es>
* godmode/agentes/alert_manager.php: Complete rewritten of the alert
system when assigned alerts to an agent.
* pandoradb.sql: New tables for alert system. These are:
talert_commands, talert_actions, talert_templates,
talert_template_modules, talert_template_module_actions. No migration
tool is available yet.
* godmode/alerts/configure_alert_template.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php: Added to repository. Administration
interface to new alert system.
* godmode/alerts/modify_alert.php: Deleted from repository.
* godmode/setup/setup.php: Added an example of the date format. Main
table has now percentage width.
* godmode/menu.php, operation/menu.php: Added new alert options.
Removed refr value when it's not neccesary.
* include/styles/pandora.css: Added width to textarea elements. Style
correction and cleanup. Tables doesn't have a odd-even pattern, but
the hovered row now changes its colour. New styles for alert pages.
* include/functions_custom_graphs.php: Added to repository. custom
graphs functions moved here.
* include/functions_incidents.php, include/functions_events.php: Moved
to LGPL. Style comment corrections.
* include/functions_html.php: Documentation style correction. Added
print_input_file() and print_label().
* include/functions_ui.php: Doc style correction.
* operation/reporting/graph_viewer.php: Include new function file with
custom graphs. Use generic functions.
* index.php: Unset pass from POST and REQUEST arrays.
* include/functions_db.php: Some documentation updated to new format.
Added format_array_to_update_sql() to generate SQL sentences for
updates. Style correction.
* godmode/agentes/configurar_agente.php: Variables renamed to have a
meaning.
* extensions/update_manager/main.php: Mark an string translatable.
* extensions/update_manager/lib/libupdate_manager_client.php,
godmode/alerts/configure_alert.php, include/functions.php,
godmode/agentes/module_manager.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
godmode/agentes/manage_config.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1331 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 15:31:01 +01:00
|
|
|
}
|
2019-01-30 16:18:44 +01:00
|
|
|
|
2020-03-02 16:17:45 +01:00
|
|
|
ui_pagination($total_actions, $url);
|
2013-06-04 18:06:58 +02:00
|
|
|
if (isset($data)) {
|
2019-01-30 16:18:44 +01:00
|
|
|
html_print_table($table);
|
2020-03-02 16:17:45 +01:00
|
|
|
ui_pagination($total_actions, $url, 0, 0, false, 'offset', true, 'pagination-bottom');
|
2019-01-30 16:18:44 +01:00
|
|
|
} else {
|
|
|
|
ui_print_info_message(['no_close' => true, 'message' => __('No alert actions configured') ]);
|
2009-11-03 12:13:47 +01:00
|
|
|
}
|
2009-01-12 Esteban Sanchez <estebans@artica.es>
* godmode/agentes/alert_manager.php: Complete rewritten of the alert
system when assigned alerts to an agent.
* pandoradb.sql: New tables for alert system. These are:
talert_commands, talert_actions, talert_templates,
talert_template_modules, talert_template_module_actions. No migration
tool is available yet.
* godmode/alerts/configure_alert_template.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php: Added to repository. Administration
interface to new alert system.
* godmode/alerts/modify_alert.php: Deleted from repository.
* godmode/setup/setup.php: Added an example of the date format. Main
table has now percentage width.
* godmode/menu.php, operation/menu.php: Added new alert options.
Removed refr value when it's not neccesary.
* include/styles/pandora.css: Added width to textarea elements. Style
correction and cleanup. Tables doesn't have a odd-even pattern, but
the hovered row now changes its colour. New styles for alert pages.
* include/functions_custom_graphs.php: Added to repository. custom
graphs functions moved here.
* include/functions_incidents.php, include/functions_events.php: Moved
to LGPL. Style comment corrections.
* include/functions_html.php: Documentation style correction. Added
print_input_file() and print_label().
* include/functions_ui.php: Doc style correction.
* operation/reporting/graph_viewer.php: Include new function file with
custom graphs. Use generic functions.
* index.php: Unset pass from POST and REQUEST arrays.
* include/functions_db.php: Some documentation updated to new format.
Added format_array_to_update_sql() to generate SQL sentences for
updates. Style correction.
* godmode/agentes/configurar_agente.php: Variables renamed to have a
meaning.
* extensions/update_manager/main.php: Mark an string translatable.
* extensions/update_manager/lib/libupdate_manager_client.php,
godmode/alerts/configure_alert.php, include/functions.php,
godmode/agentes/module_manager.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
godmode/agentes/manage_config.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1331 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 15:31:01 +01:00
|
|
|
|
2021-06-03 10:16:29 +02:00
|
|
|
if (is_management_allowed() === true) {
|
2020-07-13 12:23:46 +02:00
|
|
|
echo '<div class="action-buttons" style="width: '.$table->width.'">';
|
|
|
|
echo '<form method="post" action="index.php?sec='.$sec.'&sec2=godmode/alerts/configure_alert_action&pure='.$pure.'">';
|
|
|
|
html_print_submit_button(__('Create'), 'create', false, 'class="sub next"');
|
|
|
|
html_print_input_hidden('create_alert', 1);
|
|
|
|
echo '</form>';
|
|
|
|
echo '</div>';
|
|
|
|
}
|
2013-05-20 10:42:02 +02:00
|
|
|
|
|
|
|
enterprise_hook('close_meta_frame');
|