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
|
|
|
<?php
|
|
|
|
|
2021-11-04 16:28:15 +01:00
|
|
|
// Pandora FMS - http://pandorafms.com
|
2009-06-08 20:21:21 +02:00
|
|
|
// ==================================================
|
2020-11-27 13:52:35 +01:00
|
|
|
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
|
2009-06-08 20:21:21 +02:00
|
|
|
// Please see http://pandorafms.org for full contribution list
|
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
|
|
|
// 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.
|
2019-05-03 13:54:39 +02:00
|
|
|
// 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';
|
|
|
|
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
|
|
|
|
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 Management'
|
|
|
|
);
|
|
|
|
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
|
|
|
if (is_metaconsole()) {
|
|
|
|
$sec = 'advanced';
|
|
|
|
} else {
|
|
|
|
$sec = 'galertas';
|
|
|
|
}
|
|
|
|
|
|
|
|
$pure = (int) get_parameter('pure', 0);
|
|
|
|
$update_command = (bool) get_parameter('update_command');
|
|
|
|
$create_command = (bool) get_parameter('create_command');
|
|
|
|
$delete_command = (bool) get_parameter('delete_command');
|
|
|
|
$copy_command = (bool) get_parameter('copy_command');
|
|
|
|
|
2021-03-16 11:54:40 +01:00
|
|
|
$url = 'index.php?sec='.$sec.'&sec2=godmode/alerts/alert_commands';
|
|
|
|
|
2019-01-30 16:18:44 +01:00
|
|
|
if (is_ajax()) {
|
|
|
|
$get_alert_command = (bool) get_parameter('get_alert_command');
|
|
|
|
if ($get_alert_command) {
|
|
|
|
$id = (int) get_parameter('id', 0);
|
|
|
|
$get_recovery_fields = (int) get_parameter('get_recovery_fields', 1);
|
|
|
|
|
2021-06-04 11:34:12 +02:00
|
|
|
// Snmp alerts are not in the metaconsole so they cannot be centralized.
|
|
|
|
$is_management_allowed = false;
|
|
|
|
if ($get_recovery_fields !== 0) {
|
|
|
|
$is_management_allowed = !is_management_allowed();
|
|
|
|
}
|
2020-07-13 12:23:46 +02:00
|
|
|
|
2019-05-03 13:54:39 +02:00
|
|
|
// If command ID is not provided, check for action id.
|
2019-01-30 16:18:44 +01:00
|
|
|
if ($id == 0) {
|
|
|
|
$id_action = (int) get_parameter('id_action');
|
|
|
|
$id = alerts_get_alert_action_alert_command_id($id_action);
|
|
|
|
}
|
|
|
|
|
|
|
|
$command = alerts_get_alert_command($id);
|
|
|
|
|
2021-02-25 13:18:04 +01:00
|
|
|
// If a description is set, change the carriage return by <br> tags.
|
2019-01-30 16:18:44 +01:00
|
|
|
if (isset($command['description'])) {
|
2020-03-18 12:25:29 +01:00
|
|
|
$command['description'] = str_replace(
|
|
|
|
[
|
|
|
|
'<',
|
|
|
|
'>',
|
|
|
|
"\r\n",
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'',
|
|
|
|
'',
|
|
|
|
'<br>',
|
|
|
|
],
|
|
|
|
io_safe_output($command['description'])
|
|
|
|
);
|
2019-01-30 16:18:44 +01:00
|
|
|
}
|
|
|
|
|
2019-05-03 13:54:39 +02:00
|
|
|
// Descriptions are stored in json.
|
2019-01-30 16:18:44 +01:00
|
|
|
$fields_descriptions = empty($command['fields_descriptions']) ? '' : json_decode(io_safe_output($command['fields_descriptions']), true);
|
2019-05-03 13:54:39 +02:00
|
|
|
// Fields values are stored in json.
|
2019-01-30 16:18:44 +01:00
|
|
|
$fields_values = empty($command['fields_values']) ? '' : io_safe_output(json_decode($command['fields_values'], true));
|
2019-05-03 13:54:39 +02:00
|
|
|
// Fields hidden conditions are stored in json.
|
2019-05-03 13:46:52 +02:00
|
|
|
$fields_hidden_checked = empty($command['fields_hidden']) ? '' : io_safe_output(json_decode($command['fields_hidden'], true));
|
2019-01-30 16:18:44 +01:00
|
|
|
|
|
|
|
$fields_rows = [];
|
|
|
|
for ($i = 1; $i <= $config['max_macro_fields']; $i++) {
|
|
|
|
$field_description = $fields_descriptions[($i - 1)];
|
|
|
|
$field_value = $fields_values[($i - 1)];
|
2019-05-03 13:46:52 +02:00
|
|
|
$field_hidden = $fields_hidden_checked[($i - 1)];
|
|
|
|
|
2019-01-30 16:18:44 +01:00
|
|
|
|
|
|
|
if (!empty($field_description)) {
|
2019-05-03 13:54:39 +02:00
|
|
|
// If the value is 5, this because severity in snmp alerts is not permit to show.
|
2019-01-30 16:18:44 +01:00
|
|
|
if (($i > 5) && ($command['id'] == 3)) {
|
2021-03-11 15:40:23 +01:00
|
|
|
$fdesc = $field_description.' <br><span class="normal xx-small">'.sprintf(
|
|
|
|
__('Field %s'),
|
|
|
|
($i - 1)
|
|
|
|
).'</span>';
|
2019-01-30 16:18:44 +01:00
|
|
|
} else {
|
2021-03-11 15:40:23 +01:00
|
|
|
$fdesc = $field_description.' <br><span class="normal xx-small">'.sprintf(
|
|
|
|
__('Field %s'),
|
|
|
|
$i
|
|
|
|
).'</span>';
|
2019-01-30 16:18:44 +01:00
|
|
|
}
|
|
|
|
|
2019-05-03 13:54:39 +02:00
|
|
|
// If the field is the number one, print the help message.
|
2019-01-30 16:18:44 +01:00
|
|
|
if ($i == 1) {
|
2019-05-03 13:54:39 +02:00
|
|
|
// If our context is snmpconsole, show snmp_alert helps.
|
2019-05-24 14:26:28 +02:00
|
|
|
if ((!isset($_SERVER['HTTP_REFERER'])) && ( preg_match('/snmp_alert/', $_SERVER['HTTP_REFERER']) > 0 )) {
|
2019-01-30 16:18:44 +01:00
|
|
|
$fdesc .= ui_print_help_icon('alert_config', true);
|
2016-07-29 15:44:07 +02:00
|
|
|
}
|
2019-01-30 16:18:44 +01:00
|
|
|
}
|
|
|
|
} else {
|
2019-05-03 13:54:39 +02:00
|
|
|
// If the macro hasn't description and doesnt appear in command, set with empty description to dont show it.
|
2019-01-30 16:18:44 +01:00
|
|
|
if (($i > 5) && ($command['id'] == 3)) {
|
|
|
|
if (substr_count($command['command'], '_field'.($i - 1).'_') > 0) {
|
|
|
|
$fdesc = sprintf(__('Field %s'), ($i - 1));
|
|
|
|
} else {
|
|
|
|
$fdesc = '';
|
2016-07-29 15:44:07 +02:00
|
|
|
}
|
2019-01-30 16:18:44 +01:00
|
|
|
} else {
|
|
|
|
if (substr_count($command['command'], '_field'.$i.'_') > 0) {
|
|
|
|
$fdesc = sprintf(__('Field %s'), $i);
|
|
|
|
} else {
|
|
|
|
$fdesc = '';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-05-03 13:46:52 +02:00
|
|
|
$style = ((int) $field_hidden === 1) ? '-webkit-text-security: disc;' : '';
|
|
|
|
|
2019-01-30 16:18:44 +01:00
|
|
|
if (!empty($field_value)) {
|
|
|
|
$field_value = io_safe_output($field_value);
|
2019-05-03 13:54:39 +02:00
|
|
|
// HTML type.
|
2019-01-30 16:18:44 +01:00
|
|
|
if (preg_match('/^_html_editor_$/i', $field_value)) {
|
2021-03-11 15:40:23 +01:00
|
|
|
$editor_type_chkbx = '<div id="command_div"><b><small>';
|
2020-07-13 12:23:46 +02:00
|
|
|
$editor_type_chkbx .= __('Basic');
|
|
|
|
$editor_type_chkbx .= ui_print_help_tip(
|
|
|
|
__('For sending emails, text must be HTML format, if you want to use plain text, type it between the following labels: <pre></pre>'),
|
|
|
|
true
|
|
|
|
);
|
|
|
|
$editor_type_chkbx .= html_print_radio_button_extended(
|
|
|
|
'editor_type_value_'.$i,
|
|
|
|
0,
|
|
|
|
'',
|
|
|
|
false,
|
2021-06-03 10:16:29 +02:00
|
|
|
$is_management_allowed,
|
2020-07-13 12:23:46 +02:00
|
|
|
"removeTinyMCE('textarea_field".$i."_value')",
|
|
|
|
'',
|
|
|
|
true
|
|
|
|
);
|
2019-01-30 16:18:44 +01:00
|
|
|
$editor_type_chkbx .= ' ';
|
|
|
|
$editor_type_chkbx .= __('Advanced').' ';
|
2020-07-13 12:23:46 +02:00
|
|
|
$editor_type_chkbx .= html_print_radio_button_extended(
|
|
|
|
'editor_type_value_'.$i,
|
|
|
|
0,
|
|
|
|
'',
|
|
|
|
true,
|
2021-06-03 10:16:29 +02:00
|
|
|
$is_management_allowed,
|
2020-07-13 12:23:46 +02:00
|
|
|
"addTinyMCE('textarea_field".$i."_value')",
|
|
|
|
'',
|
|
|
|
true
|
|
|
|
);
|
2019-01-30 16:18:44 +01:00
|
|
|
$editor_type_chkbx .= '</small></b></div>';
|
|
|
|
$ffield = $editor_type_chkbx;
|
2020-07-13 12:23:46 +02:00
|
|
|
$ffield .= html_print_textarea(
|
|
|
|
'field'.$i.'_value',
|
|
|
|
1,
|
|
|
|
1,
|
|
|
|
'',
|
|
|
|
'class="fields"',
|
|
|
|
true,
|
|
|
|
'',
|
2021-06-03 10:16:29 +02:00
|
|
|
$is_management_allowed
|
2020-07-13 12:23:46 +02:00
|
|
|
);
|
2019-01-30 16:18:44 +01:00
|
|
|
|
2021-03-11 15:40:23 +01:00
|
|
|
$editor_type_chkbx = '<div id="command_div"><b><small>';
|
2019-01-30 16:18:44 +01:00
|
|
|
$editor_type_chkbx .= __('Basic').' ';
|
2020-07-13 12:23:46 +02:00
|
|
|
$editor_type_chkbx .= html_print_radio_button_extended(
|
|
|
|
'editor_type_recovery_value_'.$i,
|
|
|
|
0,
|
|
|
|
'',
|
|
|
|
false,
|
2021-06-03 10:16:29 +02:00
|
|
|
$is_management_allowed,
|
2020-07-13 12:23:46 +02:00
|
|
|
"removeTinyMCE('textarea_field".$i."_recovery_value')",
|
|
|
|
'',
|
|
|
|
true
|
|
|
|
);
|
2019-01-30 16:18:44 +01:00
|
|
|
$editor_type_chkbx .= ' ';
|
|
|
|
$editor_type_chkbx .= __('Advanced').' ';
|
2020-07-13 12:23:46 +02:00
|
|
|
$editor_type_chkbx .= html_print_radio_button_extended(
|
|
|
|
'editor_type_recovery_value_'.$i,
|
|
|
|
0,
|
|
|
|
'',
|
|
|
|
true,
|
2021-06-03 10:16:29 +02:00
|
|
|
$is_management_allowed,
|
2020-07-13 12:23:46 +02:00
|
|
|
"addTinyMCE('textarea_field".$i."_recovery_value')",
|
|
|
|
'',
|
|
|
|
true
|
|
|
|
);
|
2019-01-30 16:18:44 +01:00
|
|
|
$editor_type_chkbx .= '</small></b></div>';
|
|
|
|
$rfield = $editor_type_chkbx;
|
2020-07-13 12:23:46 +02:00
|
|
|
$rfield .= html_print_textarea(
|
|
|
|
'field'.$i.'_recovery_value',
|
|
|
|
1,
|
|
|
|
1,
|
|
|
|
'',
|
|
|
|
'class="fields_recovery"',
|
|
|
|
true,
|
|
|
|
'',
|
2021-06-03 10:16:29 +02:00
|
|
|
$is_management_allowed
|
2020-07-13 12:23:46 +02:00
|
|
|
);
|
2019-01-30 16:18:44 +01:00
|
|
|
} else if (preg_match('/^_content_type_$/i', $field_value)) {
|
2021-03-11 15:40:23 +01:00
|
|
|
$editor_type_chkbx = '<div id="command_div"><b><small>';
|
2020-07-13 12:23:46 +02:00
|
|
|
$editor_type_chkbx .= __('Text/plain');
|
|
|
|
$editor_type_chkbx .= ui_print_help_tip(
|
|
|
|
__('For sending emails only text plain'),
|
|
|
|
true
|
|
|
|
);
|
|
|
|
$editor_type_chkbx .= html_print_radio_button_extended(
|
|
|
|
'field'.$i.'_value',
|
|
|
|
'text/plain',
|
|
|
|
'',
|
|
|
|
'',
|
2021-06-03 10:16:29 +02:00
|
|
|
$is_management_allowed,
|
2020-07-13 12:23:46 +02:00
|
|
|
'',
|
|
|
|
'',
|
|
|
|
true
|
|
|
|
);
|
2019-01-30 16:18:44 +01:00
|
|
|
$editor_type_chkbx .= ' ';
|
|
|
|
$editor_type_chkbx .= __('Text/html').' ';
|
2020-07-13 12:23:46 +02:00
|
|
|
$editor_type_chkbx .= html_print_radio_button_extended(
|
|
|
|
'field'.$i.'_value',
|
|
|
|
'text/html',
|
|
|
|
'',
|
|
|
|
'text/html',
|
2021-06-03 10:16:29 +02:00
|
|
|
$is_management_allowed,
|
2020-07-13 12:23:46 +02:00
|
|
|
'',
|
|
|
|
'',
|
|
|
|
true
|
|
|
|
);
|
2019-01-30 16:18:44 +01:00
|
|
|
$editor_type_chkbx .= '</small></b></div>';
|
|
|
|
$ffield = $editor_type_chkbx;
|
|
|
|
|
2021-03-11 15:40:23 +01:00
|
|
|
$editor_type_chkbx = '<div id="command_div"><b><small>';
|
2020-07-13 12:23:46 +02:00
|
|
|
$editor_type_chkbx .= __('Text/plain');
|
|
|
|
$editor_type_chkbx .= ui_print_help_tip(
|
|
|
|
__('For sending emails only text plain'),
|
|
|
|
true
|
|
|
|
);
|
|
|
|
$editor_type_chkbx .= html_print_radio_button_extended(
|
|
|
|
'field'.$i.'_recovery_value',
|
|
|
|
'text/plain',
|
|
|
|
'',
|
|
|
|
'',
|
2021-06-03 10:16:29 +02:00
|
|
|
$is_management_allowed,
|
2020-07-13 12:23:46 +02:00
|
|
|
'',
|
|
|
|
'',
|
|
|
|
true
|
|
|
|
);
|
2019-01-30 16:18:44 +01:00
|
|
|
$editor_type_chkbx .= ' ';
|
|
|
|
$editor_type_chkbx .= __('Text/html').' ';
|
2020-07-13 12:23:46 +02:00
|
|
|
$editor_type_chkbx .= html_print_radio_button_extended(
|
|
|
|
'field'.$i.'_recovery_value',
|
|
|
|
'text/html',
|
|
|
|
'',
|
|
|
|
'text/html',
|
2021-06-03 10:16:29 +02:00
|
|
|
$is_management_allowed,
|
2020-07-13 12:23:46 +02:00
|
|
|
'',
|
|
|
|
'',
|
|
|
|
true
|
|
|
|
);
|
2019-01-30 16:18:44 +01:00
|
|
|
$editor_type_chkbx .= '</small></b></div>';
|
|
|
|
$rfield = $editor_type_chkbx;
|
2019-05-03 13:54:39 +02:00
|
|
|
// Select type.
|
2021-02-25 13:18:04 +01:00
|
|
|
} else if (preg_match('/^_integria_type_custom_field_$/i', $field_value)) {
|
|
|
|
$ffield = '';
|
|
|
|
$rfield = '';
|
|
|
|
|
|
|
|
$ffield .= '<div name="field'.$i.'_value_container">'.html_print_switch(
|
|
|
|
[
|
|
|
|
'name' => 'field'.$i.'_value[]',
|
|
|
|
'value' => '',
|
|
|
|
]
|
|
|
|
).'</div>';
|
|
|
|
$rfield .= '<div name="field'.$i.'_recovery_value_container">'.html_print_switch(
|
|
|
|
[
|
|
|
|
'name' => 'field'.$i.'_recovery_value[]',
|
|
|
|
'value' => '',
|
|
|
|
]
|
|
|
|
).'</div>';
|
|
|
|
|
|
|
|
$ffield .= html_print_select(
|
|
|
|
'',
|
|
|
|
'field'.$i.'_value[]',
|
|
|
|
'',
|
|
|
|
'',
|
|
|
|
__('None'),
|
|
|
|
'',
|
|
|
|
true,
|
|
|
|
false,
|
|
|
|
false,
|
|
|
|
'fields',
|
2021-06-03 10:16:29 +02:00
|
|
|
$is_management_allowed
|
2021-02-25 13:18:04 +01:00
|
|
|
);
|
|
|
|
|
|
|
|
$rfield .= html_print_select(
|
|
|
|
'',
|
|
|
|
'field'.$i.'_recovery_value[]',
|
|
|
|
'',
|
|
|
|
'',
|
|
|
|
__('None'),
|
|
|
|
'',
|
|
|
|
true,
|
|
|
|
false,
|
|
|
|
false,
|
|
|
|
'fields',
|
2021-06-03 10:16:29 +02:00
|
|
|
$is_management_allowed
|
2021-02-25 13:18:04 +01:00
|
|
|
);
|
|
|
|
|
|
|
|
$ffield .= html_print_input_text('field'.$i.'_value[]', '', '', 10, 10, true, false, false, '', 'datepicker');
|
|
|
|
$rfield .= html_print_input_text('field'.$i.'_recovery_value[]', '', '', 10, 10, true, false, false, '', 'datepicker');
|
|
|
|
|
|
|
|
$ffield .= html_print_textarea(
|
|
|
|
'field'.$i.'_value[]',
|
|
|
|
1,
|
|
|
|
1,
|
|
|
|
'',
|
|
|
|
'style="min-height:40px; '.$style.'" class="fields"',
|
|
|
|
true,
|
|
|
|
'',
|
2021-06-03 10:16:29 +02:00
|
|
|
$is_management_allowed
|
2021-02-25 13:18:04 +01:00
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
$rfield .= html_print_textarea(
|
|
|
|
'field'.$i.'_recovery_value[]',
|
|
|
|
1,
|
|
|
|
1,
|
|
|
|
'',
|
|
|
|
'style="min-height:40px; '.$style.'" class="fields_recovery',
|
|
|
|
true,
|
|
|
|
'',
|
2021-06-03 10:16:29 +02:00
|
|
|
$is_management_allowed
|
2021-02-25 13:18:04 +01:00
|
|
|
);
|
2019-01-30 16:18:44 +01:00
|
|
|
} else {
|
|
|
|
$fields_value_select = [];
|
|
|
|
$fv = explode(';', $field_value);
|
|
|
|
|
|
|
|
if (count($fv) > 1) {
|
|
|
|
if (!empty($fv)) {
|
|
|
|
foreach ($fv as $fv_option) {
|
|
|
|
$fv_option = explode(',', $fv_option);
|
|
|
|
|
|
|
|
if (empty($fv_option)) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!isset($fv_option[1])) {
|
|
|
|
$fv_option[1] = $fv_option[0];
|
|
|
|
}
|
|
|
|
|
|
|
|
$fields_value_select[$fv_option[0]] = $fv_option[1];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
$ffield = html_print_select(
|
|
|
|
$fields_value_select,
|
|
|
|
'field'.$i.'_value',
|
|
|
|
'',
|
|
|
|
'',
|
2020-08-25 10:58:26 +02:00
|
|
|
__('None'),
|
2020-08-25 15:03:19 +02:00
|
|
|
'',
|
2019-01-30 16:18:44 +01:00
|
|
|
true,
|
|
|
|
false,
|
|
|
|
false,
|
2020-07-13 12:23:46 +02:00
|
|
|
'fields',
|
2021-06-03 10:16:29 +02:00
|
|
|
$is_management_allowed
|
2019-01-30 16:18:44 +01:00
|
|
|
);
|
|
|
|
$rfield = html_print_select(
|
|
|
|
$fields_value_select,
|
|
|
|
'field'.$i.'_recovery_value',
|
|
|
|
'',
|
|
|
|
'',
|
2021-03-11 17:54:20 +01:00
|
|
|
__('None'),
|
2019-01-30 16:18:44 +01:00
|
|
|
0,
|
|
|
|
true,
|
|
|
|
false,
|
|
|
|
false,
|
2020-07-13 12:23:46 +02:00
|
|
|
'fields_recovery',
|
2021-06-03 10:16:29 +02:00
|
|
|
$is_management_allowed
|
2019-01-30 16:18:44 +01:00
|
|
|
);
|
|
|
|
} else {
|
|
|
|
$ffield = html_print_textarea(
|
|
|
|
'field'.$i.'_value',
|
|
|
|
1,
|
|
|
|
1,
|
|
|
|
$fv[0],
|
2021-03-11 15:40:23 +01:00
|
|
|
'style="'.$style.'" class="fields min-height-40px"',
|
2020-07-13 12:23:46 +02:00
|
|
|
true,
|
|
|
|
'',
|
2021-06-03 10:16:29 +02:00
|
|
|
$is_management_allowed
|
2019-01-30 16:18:44 +01:00
|
|
|
);
|
|
|
|
$rfield = html_print_textarea(
|
|
|
|
'field'.$i.'_recovery_value',
|
|
|
|
1,
|
|
|
|
1,
|
|
|
|
$fv[0],
|
2021-03-11 15:40:23 +01:00
|
|
|
'style="'.$style.'" class="fields_recovery min-height-40px',
|
2020-07-13 12:23:46 +02:00
|
|
|
true,
|
|
|
|
'',
|
2021-06-03 10:16:29 +02:00
|
|
|
$is_management_allowed
|
2019-01-30 16:18:44 +01:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
$ffield = html_print_textarea(
|
|
|
|
'field'.$i.'_value',
|
|
|
|
1,
|
|
|
|
1,
|
|
|
|
'',
|
2021-03-11 15:40:23 +01:00
|
|
|
'style="'.$style.'" class="fields min-height-40px"',
|
2020-07-13 12:23:46 +02:00
|
|
|
true,
|
|
|
|
'',
|
2021-06-03 10:16:29 +02:00
|
|
|
$is_management_allowed
|
2019-01-30 16:18:44 +01:00
|
|
|
);
|
|
|
|
$rfield = html_print_textarea(
|
|
|
|
'field'.$i.'_recovery_value',
|
|
|
|
1,
|
|
|
|
1,
|
|
|
|
'',
|
2021-03-11 15:40:23 +01:00
|
|
|
'style="'.$style.'" class="fields_recovery min-height-40px"',
|
2020-07-13 12:23:46 +02:00
|
|
|
true,
|
|
|
|
'',
|
2021-06-03 10:16:29 +02:00
|
|
|
$is_management_allowed
|
2019-01-30 16:18:44 +01:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2019-05-03 13:54:39 +02:00
|
|
|
// The empty descriptions will be ignored.
|
2019-01-30 16:18:44 +01:00
|
|
|
if ($fdesc == '') {
|
|
|
|
$fields_rows[$i] = '';
|
|
|
|
} else {
|
|
|
|
$fields_rows[$i] = '<tr id="table_macros-field'.$i.'" class="datos">';
|
2021-03-11 15:40:23 +01:00
|
|
|
$fields_rows[$i] .= '<td class="datos bolder w20p">'.$fdesc.'</td>';
|
2019-01-30 16:18:44 +01:00
|
|
|
$fields_rows[$i] .= '<td class="datos">'.$ffield.'</td>';
|
|
|
|
if ($get_recovery_fields) {
|
|
|
|
$fields_rows[$i] .= '<td class="datos recovery_col">'.$rfield.'</td>';
|
|
|
|
}
|
|
|
|
|
|
|
|
$fields_rows[$i] .= '</tr>';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-05-03 13:54:39 +02:00
|
|
|
// If command is PandoraFMS event, field 5 must be empty because "severity" must be set by the alert.
|
2019-01-30 16:18:44 +01:00
|
|
|
$command['fields_rows'] = $fields_rows;
|
|
|
|
|
|
|
|
echo json_encode($command);
|
|
|
|
}
|
|
|
|
|
|
|
|
return;
|
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-26 09:11:10 +01:00
|
|
|
// This check should be after ajax. Because, ajax will be called from configure_alert_action.
|
2021-04-15 12:33:31 +02:00
|
|
|
if (!check_acl($config['id_user'], 0, 'PM') && !is_user_admin(
|
|
|
|
$config['id_user
|
|
|
|
']
|
|
|
|
)
|
|
|
|
) {
|
2021-03-26 09:11:10 +01:00
|
|
|
echo "<div id='message_permissions' title='".__('Permissions warning')."' s
|
|
|
|
tyle='display:none;'>";
|
2021-04-15 12:33:31 +02:00
|
|
|
echo "<p style='text-align: center;font-weight: bold; margin: 15px'>".__(
|
|
|
|
'Command management is limited to administrator users or user profiles with permissions PM'
|
|
|
|
).'</p>';
|
2021-03-26 09:11:10 +01:00
|
|
|
echo '</div>';
|
|
|
|
}
|
|
|
|
|
2015-07-14 18:34:16 +02:00
|
|
|
enterprise_hook('open_meta_frame');
|
2015-03-09 16:17:57 +01:00
|
|
|
|
|
|
|
if ($update_command) {
|
2019-01-30 16:18:44 +01:00
|
|
|
include_once 'configure_alert_command.php';
|
|
|
|
return;
|
2015-03-09 16:17:57 +01:00
|
|
|
}
|
|
|
|
|
2019-05-03 13:54:39 +02:00
|
|
|
// Header.
|
2019-01-30 16:18:44 +01:00
|
|
|
if (defined('METACONSOLE')) {
|
|
|
|
alerts_meta_print_header();
|
|
|
|
} else {
|
2019-04-29 14:36:02 +02:00
|
|
|
ui_print_page_header(
|
|
|
|
__('Alerts').' » '.__('Alert commands'),
|
|
|
|
'images/gm_alerts.png',
|
|
|
|
false,
|
2020-05-29 11:37:06 +02:00
|
|
|
'',
|
2019-04-29 14:36:02 +02:00
|
|
|
true
|
|
|
|
);
|
2019-01-30 16:18:44 +01:00
|
|
|
}
|
2010-03-02 18:19:44 +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
|
|
|
if ($create_command) {
|
2019-01-30 16:18:44 +01:00
|
|
|
$name = (string) get_parameter('name');
|
|
|
|
$command = (string) get_parameter('command');
|
|
|
|
$description = (string) get_parameter('description');
|
|
|
|
$id_group = (string) get_parameter('id_group', 0);
|
|
|
|
|
|
|
|
$fields_descriptions = [];
|
|
|
|
$fields_values = [];
|
2019-05-03 13:46:52 +02:00
|
|
|
$fields_hidden = [];
|
2019-01-30 16:18:44 +01:00
|
|
|
$info_fields = '';
|
|
|
|
$values = [];
|
|
|
|
for ($i = 1; $i <= $config['max_macro_fields']; $i++) {
|
|
|
|
$fields_descriptions[] = (string) get_parameter('field'.$i.'_description');
|
|
|
|
$fields_values[] = (string) get_parameter('field'.$i.'_values');
|
2019-05-03 13:46:52 +02:00
|
|
|
$fields_hidden[] = get_parameter('field'.$i.'_hide');
|
2019-01-30 16:18:44 +01:00
|
|
|
$info_fields .= ' Field'.$i.': '.$fields_values[($i - 1)];
|
|
|
|
}
|
|
|
|
|
|
|
|
$values['fields_values'] = io_json_mb_encode($fields_values);
|
|
|
|
$values['fields_descriptions'] = io_json_mb_encode($fields_descriptions);
|
2019-05-03 13:46:52 +02:00
|
|
|
$values['fields_hidden'] = io_json_mb_encode($fields_hidden);
|
2019-01-30 16:18:44 +01:00
|
|
|
$values['description'] = $description;
|
|
|
|
$values['id_group'] = $id_group;
|
|
|
|
|
|
|
|
$name_check = db_get_value('name', 'talert_commands', 'name', $name);
|
|
|
|
|
|
|
|
if (!$name_check) {
|
|
|
|
$result = alerts_create_alert_command(
|
|
|
|
$name,
|
|
|
|
$command,
|
|
|
|
$values
|
|
|
|
);
|
|
|
|
|
|
|
|
$info = '{"Name":"'.$name.'","Command":"'.$command.'","Description":"'.$description.' '.$info_fields.'"}';
|
|
|
|
} else {
|
|
|
|
$result = '';
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($result) {
|
2022-01-20 10:55:23 +01:00
|
|
|
db_pandora_audit(
|
2022-02-03 12:54:50 +01:00
|
|
|
AUDIT_LOG_ALERT_MANAGEMENT,
|
2022-01-20 10:55:23 +01:00
|
|
|
'Create alert command #'.$result,
|
|
|
|
false,
|
|
|
|
false,
|
|
|
|
$info
|
|
|
|
);
|
2019-01-30 16:18:44 +01:00
|
|
|
} else {
|
2022-01-20 10:55:23 +01:00
|
|
|
db_pandora_audit(
|
2022-02-03 12:54:50 +01:00
|
|
|
AUDIT_LOG_ALERT_MANAGEMENT,
|
2022-01-20 10:55:23 +01:00
|
|
|
'Fail try to create alert command',
|
|
|
|
false,
|
|
|
|
false
|
|
|
|
);
|
2019-01-30 16:18:44 +01:00
|
|
|
}
|
|
|
|
|
2019-05-03 13:54:39 +02:00
|
|
|
// Show errors.
|
2019-01-30 16:18:44 +01:00
|
|
|
if (!isset($messageAction)) {
|
|
|
|
$messageAction = __('Could not be created');
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($name == '') {
|
|
|
|
$messageAction = __('No name specified');
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($command == '') {
|
|
|
|
$messageAction = __('No command specified');
|
|
|
|
}
|
|
|
|
|
|
|
|
$messageAction = ui_print_result_message(
|
|
|
|
$result,
|
|
|
|
__('Successfully created'),
|
|
|
|
$messageAction
|
|
|
|
);
|
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_command) {
|
2019-01-30 16:18:44 +01:00
|
|
|
$id = (int) get_parameter('id');
|
|
|
|
|
2019-05-03 13:54:39 +02:00
|
|
|
// Internal commands cannot be deleted.
|
2019-01-30 16:18:44 +01:00
|
|
|
if (alerts_get_alert_command_internal($id)) {
|
|
|
|
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';
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
$result = alerts_delete_alert_command($id);
|
|
|
|
|
2022-02-03 12:54:50 +01:00
|
|
|
$auditMessage = ((bool) $result === true)
|
|
|
|
? sprintf('Delete alert command #%s', $id)
|
|
|
|
: sprintf('Fail try to delete alert command #%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')
|
|
|
|
);
|
2018-10-22 12:01:29 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
if ($copy_command) {
|
2019-01-30 16:18:44 +01:00
|
|
|
$id = (int) get_parameter('id');
|
|
|
|
|
2019-05-03 13:54:39 +02:00
|
|
|
// Get the info from the source command.
|
2019-01-30 16:18:44 +01:00
|
|
|
$command_to_copy = db_get_row('talert_commands', 'id', $id);
|
|
|
|
if ($command_to_copy === false) {
|
|
|
|
ui_print_error_message(__("Command with id $id does not found."));
|
|
|
|
} else {
|
2019-05-03 13:54:39 +02:00
|
|
|
// Prepare to insert the copy with same values.
|
2019-01-30 16:18:44 +01:00
|
|
|
unset($command_to_copy['id']);
|
|
|
|
$command_to_copy['name'] .= __(' (copy)');
|
|
|
|
$result = db_process_sql_insert('talert_commands', $command_to_copy);
|
|
|
|
|
2019-05-03 13:54:39 +02:00
|
|
|
// Print the result.
|
2019-01-30 16:18:44 +01:00
|
|
|
ui_print_result_message(
|
|
|
|
$result,
|
|
|
|
__('Successfully copied'),
|
|
|
|
__('Could not be copied')
|
|
|
|
);
|
|
|
|
}
|
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_commands&tab=command&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 commands 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
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
$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';
|
2015-06-16 16:09:50 +02:00
|
|
|
|
2019-01-30 16:18:44 +01:00
|
|
|
$table->data = [];
|
|
|
|
$table->head = [];
|
2018-10-22 10:08:25 +02:00
|
|
|
$table->head['name'] = __('Name');
|
|
|
|
$table->head['id'] = __('ID');
|
|
|
|
$table->head['group'] = __('Group');
|
|
|
|
$table->head['description'] = __('Description');
|
2018-10-22 12:01:29 +02:00
|
|
|
$table->head['action'] = __('Actions');
|
2019-01-30 16:18:44 +01:00
|
|
|
$table->style = [];
|
2018-10-22 10:08:25 +02:00
|
|
|
$table->style['name'] = 'font-weight: bold';
|
2019-01-30 16:18:44 +01:00
|
|
|
$table->size = [];
|
2018-10-22 10:08:25 +02:00
|
|
|
$table->size['action'] = '40px';
|
2019-01-30 16:18:44 +01:00
|
|
|
$table->align = [];
|
2018-10-22 10:08:25 +02:00
|
|
|
$table->align['action'] = '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
|
|
|
|
2018-10-22 10:08:25 +02:00
|
|
|
$commands = db_get_all_rows_filter(
|
2019-01-30 16:18:44 +01:00
|
|
|
'talert_commands',
|
|
|
|
['id_group' => array_keys(users_get_groups(false, 'LM'))]
|
2018-10-22 10:08:25 +02:00
|
|
|
);
|
2019-01-30 16:18:44 +01:00
|
|
|
if ($commands === false) {
|
|
|
|
$commands = [];
|
|
|
|
}
|
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-16 11:54:40 +01:00
|
|
|
// Pagination.
|
|
|
|
$total_commands = count($commands);
|
|
|
|
$offset = (int) get_parameter('offset');
|
|
|
|
$limit = (int) $config['block_size'];
|
|
|
|
$commands = array_slice($commands, $offset, $limit);
|
|
|
|
|
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 ($commands as $command) {
|
2019-01-30 16:18:44 +01:00
|
|
|
$data = [];
|
|
|
|
|
2021-03-11 15:40:23 +01:00
|
|
|
$data['name'] = '<span>';
|
2021-01-20 18:22:43 +01:00
|
|
|
|
|
|
|
// (IMPORTANT, DO NOT CHANGE!) only users with permissions over "All" group have access to edition of commands belonging to "All" group.
|
2021-03-01 13:58:04 +01:00
|
|
|
if (!$command['internal'] && check_acl_restricted_all($config['id_user'], $command['id_group'], 'PM')) {
|
2019-01-30 16:18:44 +01:00
|
|
|
$data['name'] .= '<a href="index.php?sec='.$sec.'&sec2=godmode/alerts/configure_alert_command&id='.$command['id'].'&pure='.$pure.'">'.$command['name'].'</a>';
|
|
|
|
} else {
|
|
|
|
$data['name'] .= $command['name'];
|
|
|
|
}
|
|
|
|
|
|
|
|
$data['name'] .= '</span>';
|
|
|
|
$data['id'] = $command['id'];
|
|
|
|
$data['group'] = ui_print_group_icon($command['id_group'], true);
|
|
|
|
$data['description'] = str_replace(
|
2020-03-18 12:25:29 +01:00
|
|
|
[
|
|
|
|
'<',
|
|
|
|
'>',
|
|
|
|
"\r\n",
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'',
|
|
|
|
'',
|
|
|
|
'<br>',
|
|
|
|
],
|
2019-01-30 16:18:44 +01:00
|
|
|
io_safe_output($command['description'])
|
|
|
|
);
|
|
|
|
$data['action'] = '';
|
2019-04-02 13:42:30 +02:00
|
|
|
$table->cellclass[]['action'] = 'action_buttons';
|
2021-01-20 18:22:43 +01:00
|
|
|
|
|
|
|
// (IMPORTANT, DO NOT CHANGE!) only users with permissions over "All" group have access to edition of commands belonging to "All" group.
|
2021-06-03 10:16:29 +02:00
|
|
|
if ($is_management_allowed === true && !$command['internal'] && check_acl_restricted_all($config['id_user'], $command['id_group'], 'LM')) {
|
2021-04-15 12:33:31 +02:00
|
|
|
if (check_acl($config['id_user'], 0, 'PM') || is_user_admin(
|
|
|
|
$config['id_user
|
|
|
|
']
|
|
|
|
)
|
|
|
|
) {
|
|
|
|
$data['action'] = '<span class="inline_flex">';
|
|
|
|
$data['action'] .= '<a href="index.php?sec='.$sec.'&sec2=godmode/alerts/alert_commands&copy_command=1&id='.$command['id'].'&pure='.$pure.'"
|
|
|
|
onClick="if (!confirm(\''.__('Are you sure?').'\')) return false;">'.html_print_image('images/copy.png', true, ['class' => 'invert_filter']).'</a>';
|
|
|
|
|
|
|
|
$data['action'] .= '<a href="index.php?sec='.$sec.'&sec2=godmode/alerts/alert_commands&delete_command=1&id='.$command['id'].'&pure='.$pure.'"
|
2021-03-11 15:40:23 +01:00
|
|
|
onClick="if (!confirm(\''.__('Are you sure?').'\')) return false;">'.html_print_image('images/cross.png', true, ['class' => 'invert_filter']).'</a>';
|
2021-04-15 12:33:31 +02:00
|
|
|
$data['action'] .= '</span>';
|
|
|
|
}
|
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
|
|
|
}
|
|
|
|
|
2021-03-16 11:54:40 +01:00
|
|
|
ui_pagination($total_commands, $url);
|
|
|
|
if (isset($data) === true && count($table->data) > 0) {
|
2019-01-30 16:18:44 +01:00
|
|
|
html_print_table($table);
|
2021-03-16 11:54:40 +01:00
|
|
|
ui_pagination($total_commands, $url, 0, 0, false, 'offset', true, 'pagination-bottom');
|
2019-01-30 16:18:44 +01:00
|
|
|
} else {
|
2021-03-16 11:54:40 +01:00
|
|
|
ui_print_info_message(
|
|
|
|
[
|
|
|
|
'no_close' => true,
|
|
|
|
'message' => __('No alert commands configured'),
|
|
|
|
]
|
|
|
|
);
|
2011-07-21 14:37:24 +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
|
|
|
|
2021-06-03 10:16:29 +02:00
|
|
|
if ($is_management_allowed === true && check_acl_restricted_all($config['id_user'], $command['id_group'], 'PM')) {
|
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_command&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');
|
2021-03-01 13:58:04 +01:00
|
|
|
|
|
|
|
?>
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
$(document).ready(function () {
|
|
|
|
dialog_message("#message_permissions");
|
|
|
|
});
|
|
|
|
|
|
|
|
function dialog_message(message) {
|
|
|
|
$(message)
|
|
|
|
.css("display", "inline")
|
|
|
|
.dialog({
|
|
|
|
modal: true,
|
|
|
|
width: "400px",
|
|
|
|
buttons: {
|
|
|
|
Close: function() {
|
|
|
|
$(this).dialog("close");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2021-03-16 11:54:40 +01:00
|
|
|
</script>
|