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.
|
|
|
|
// 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
|
|
|
|
2015-03-06 12:28:05 +01:00
|
|
|
enterprise_hook('open_meta_frame');
|
|
|
|
|
2019-01-30 16:18:44 +01:00
|
|
|
if (is_ajax()) {
|
|
|
|
$get_template_tooltip = (bool) get_parameter('get_template_tooltip');
|
|
|
|
|
|
|
|
if ($get_template_tooltip) {
|
|
|
|
$id_template = (int) get_parameter('id_template');
|
|
|
|
$template = alerts_get_alert_template($id_template);
|
|
|
|
if ($template === false) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
echo '<h3>'.$template['name'].'</h3>';
|
|
|
|
echo '<strong>'.__('Type').': </strong>';
|
|
|
|
echo alerts_get_alert_templates_type_name($template['type']);
|
|
|
|
|
|
|
|
echo '<br />';
|
|
|
|
echo ui_print_alert_template_example($template['id'], true);
|
|
|
|
|
|
|
|
echo '<br />';
|
|
|
|
|
|
|
|
if ($template['description'] != '') {
|
|
|
|
echo '<strong>'.__('Description').':</strong><br />';
|
|
|
|
echo $template['description'];
|
|
|
|
echo '<br />';
|
|
|
|
}
|
|
|
|
|
|
|
|
echo '<strong>'.__('Priority').':</strong> ';
|
|
|
|
echo get_priority_name($template['priority']);
|
|
|
|
echo '<br />';
|
|
|
|
|
|
|
|
if ($template['monday'] && $template['tuesday']
|
|
|
|
&& $template['wednesday'] && $template['thursday']
|
|
|
|
&& $template['friday'] && $template['saturday']
|
|
|
|
&& $template['sunday']
|
|
|
|
) {
|
|
|
|
// Everyday
|
|
|
|
echo '<strong>'.__('Everyday').'</strong><br />';
|
|
|
|
} else {
|
|
|
|
$days = [
|
|
|
|
'monday' => __('Monday'),
|
|
|
|
'tuesday' => __('Tuesday'),
|
|
|
|
'wednesday' => __('Wednesday'),
|
|
|
|
'thursday' => __('Thursday'),
|
|
|
|
'friday' => __('Friday'),
|
|
|
|
'saturday' => __('Saturday'),
|
|
|
|
'sunday' => __('Sunday'),
|
|
|
|
];
|
|
|
|
|
|
|
|
echo '<strong>'.__('Days').'</strong>: '.__('Every').' ';
|
|
|
|
$actives = [];
|
|
|
|
foreach ($days as $day => $name) {
|
|
|
|
if ($template[$day]) {
|
|
|
|
array_push($actives, $name);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
$last = array_pop($actives);
|
|
|
|
if (count($actives)) {
|
|
|
|
echo implode(', ', $actives);
|
|
|
|
echo ' '.__('and').' ';
|
|
|
|
}
|
|
|
|
|
|
|
|
echo $last;
|
|
|
|
echo '<br />';
|
|
|
|
}
|
|
|
|
|
|
|
|
echo '<strong>'.__('Time threshold').': </strong>';
|
|
|
|
echo human_time_description_raw($template['time_threshold']);
|
|
|
|
echo '<br />';
|
|
|
|
|
|
|
|
if ($template['time_from'] != $template['time_to']) {
|
|
|
|
echo '<strong>'.__('From').'</strong> ';
|
|
|
|
echo $template['time_from'];
|
|
|
|
echo ' <strong>'.__('to').'</strong> ';
|
|
|
|
echo $template['time_to'];
|
|
|
|
echo '<br />';
|
|
|
|
}
|
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
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
|
|
|
}
|
|
|
|
|
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-10-26 Ramon Novoa <rnovoa@artica.es>
* extensions/update_manager.php,
operation/incidents/incident.php,
operation/menu.php,
godmode/setup/links.php,
godmode/users/configure_user.php,
godmode/agentes/planned_downtime.php,
godmode/agentes/agent_manager.php,
godmode/reporting/reporting_builder.php,
godmode/reporting/map_builder.php,
godmode/reporting/graphs.php,
godmode/reporting/graph_builder.php,
godmode/alerts/alert_templates.php,
godmode/menu.php: Several ACL related fixes.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2053 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-10-26 19:51:29 +01:00
|
|
|
}
|
|
|
|
|
2019-01-30 16:18:44 +01:00
|
|
|
$update_template = (bool) get_parameter('update_template');
|
|
|
|
$delete_template = (bool) get_parameter('delete_template');
|
2012-12-12 20:37:35 +01:00
|
|
|
$pure = get_parameter('pure', 0);
|
2022-01-20 10:55:23 +01:00
|
|
|
$sec = (is_metaconsole() === true) ? 'advanced' : 'galertas';
|
2011-02-15 14:17:26 +01:00
|
|
|
|
2020-07-13 12:23:46 +02:00
|
|
|
// This prevents to duplicate the header in
|
|
|
|
// case delete_templete action is performed.
|
2012-12-12 20:37:35 +01:00
|
|
|
if (!$delete_template) {
|
2020-07-13 12:23:46 +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 templates'),
|
|
|
|
'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
|
|
|
}
|
2012-12-12 20:37:35 +01:00
|
|
|
}
|
2013-05-20 10:42:02 +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
|
|
|
if ($update_template) {
|
2019-01-30 16:18:44 +01:00
|
|
|
$id = (int) get_parameter('id');
|
|
|
|
|
|
|
|
$recovery_notify = (bool) get_parameter('recovery_notify');
|
|
|
|
|
|
|
|
$fields_recovery = [];
|
2020-12-03 15:51:40 +01:00
|
|
|
for ($i = 1; $i <= $config['max_macro_fields']; $i++) {
|
2019-01-30 16:18:44 +01:00
|
|
|
$values['field'.$i] = (string) get_parameter('field'.$i);
|
2020-07-13 12:23:46 +02:00
|
|
|
$values['field'.$i.'_recovery'] = ($recovery_notify) ? (string) get_parameter('field'.$i.'_recovery') : '';
|
2019-01-30 16:18:44 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
$values['recovery_notify'] = $recovery_notify;
|
|
|
|
$result = alerts_update_alert_template($id, $values);
|
|
|
|
|
|
|
|
ui_print_result_message(
|
|
|
|
$result,
|
|
|
|
__('Successfully updated'),
|
|
|
|
__('Could not be updated')
|
|
|
|
);
|
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-07-13 12:23:46 +02:00
|
|
|
// If user tries to delete a template with group=ALL
|
|
|
|
// then must have "PM" access privileges.
|
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_template) {
|
2019-01-30 16:18:44 +01:00
|
|
|
$id = get_parameter('id');
|
|
|
|
$al_template = alerts_get_alert_template($id);
|
|
|
|
|
|
|
|
if ($al_template !== false) {
|
2020-07-13 12:23:46 +02:00
|
|
|
// If user tries to delete a template with group=ALL
|
|
|
|
// then must have "PM" access privileges.
|
2019-01-30 16:18:44 +01:00
|
|
|
if ($al_template['id_group'] == 0) {
|
|
|
|
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;
|
|
|
|
} else {
|
|
|
|
if (defined('METACONSOLE')) {
|
|
|
|
alerts_meta_print_header();
|
|
|
|
} else {
|
|
|
|
ui_print_page_header(
|
|
|
|
__('Alerts').' » '.__('Alert templates'),
|
|
|
|
'images/gm_alerts.png',
|
|
|
|
false,
|
|
|
|
'alerts_config',
|
|
|
|
true
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
2020-07-13 12:23:46 +02:00
|
|
|
} else {
|
2019-01-30 16:18:44 +01:00
|
|
|
$own_info = get_user_info($config['id_user']);
|
|
|
|
if ($own_info['is_admin'] || check_acl($config['id_user'], 0, 'PM')) {
|
|
|
|
$own_groups = array_keys(users_get_groups($config['id_user'], 'LM'));
|
|
|
|
} else {
|
|
|
|
$own_groups = array_keys(users_get_groups($config['id_user'], 'LM', false));
|
|
|
|
}
|
|
|
|
|
|
|
|
$is_in_group = in_array($al_template['id_group'], $own_groups);
|
2020-07-13 12:23:46 +02:00
|
|
|
// Then template group have to be is his own groups.
|
2019-01-30 16:18:44 +01:00
|
|
|
if ($is_in_group) {
|
|
|
|
if (defined('METACONSOLE')) {
|
|
|
|
alerts_meta_print_header();
|
|
|
|
} else {
|
2019-04-29 14:36:02 +02:00
|
|
|
ui_print_page_header(
|
|
|
|
__('Alerts').' » '.__('Alert templates'),
|
|
|
|
'images/gm_alerts.png',
|
|
|
|
false,
|
|
|
|
'alerts_config',
|
|
|
|
true
|
|
|
|
);
|
2019-01-30 16:18:44 +01:00
|
|
|
}
|
|
|
|
} else {
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
if (defined('METACONSOLE')) {
|
|
|
|
alerts_meta_print_header();
|
|
|
|
} else {
|
2019-04-29 14:36:02 +02:00
|
|
|
ui_print_page_header(
|
|
|
|
__('Alerts').' » '.__('Alert templates'),
|
|
|
|
'images/gm_alerts.png',
|
|
|
|
false,
|
|
|
|
'alerts_config',
|
|
|
|
true
|
|
|
|
);
|
2019-01-30 16:18:44 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
$result = alerts_delete_alert_template($id);
|
|
|
|
|
|
|
|
if ($result) {
|
2020-07-13 12:23:46 +02:00
|
|
|
db_pandora_audit(
|
2022-01-20 10:55:23 +01:00
|
|
|
AUDIT_LOG_ALERT_MANAGEMENT,
|
2020-07-13 12:23:46 +02:00
|
|
|
'Delete alert template #'.$id
|
|
|
|
);
|
2019-01-30 16:18:44 +01:00
|
|
|
} else {
|
2020-07-13 12:23:46 +02:00
|
|
|
db_pandora_audit(
|
2022-01-20 10:55:23 +01:00
|
|
|
AUDIT_LOG_ALERT_MANAGEMENT,
|
2020-07-13 12:23:46 +02:00
|
|
|
'Fail try to delete alert template #'.$id
|
|
|
|
);
|
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
|
|
|
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_templates&tab=template'
|
|
|
|
).'">'.__('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 templates 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
|
|
|
);
|
|
|
|
}
|
2009-05-20 16:19:38 +02:00
|
|
|
|
2019-01-30 16:18:44 +01:00
|
|
|
$search_string = (string) get_parameter('search_string');
|
|
|
|
$search_type = (string) get_parameter('search_type');
|
|
|
|
$url = ui_get_url_refresh(
|
|
|
|
[
|
|
|
|
'offset' => false,
|
|
|
|
'search_string' => $search_string,
|
|
|
|
'search_type' => $search_type,
|
2019-04-29 14:45:11 +02:00
|
|
|
],
|
|
|
|
true,
|
|
|
|
false
|
2019-01-30 16:18:44 +01:00
|
|
|
);
|
2016-01-22 09:29:07 +01:00
|
|
|
|
2015-06-25 10:07:53 +02:00
|
|
|
$table = new stdClass();
|
2015-06-16 16:09:50 +02:00
|
|
|
$table->width = '100%';
|
|
|
|
$table->class = 'databox filters';
|
2020-07-13 12:23:46 +02:00
|
|
|
if (is_metaconsole() === true) {
|
2019-01-30 16:18:44 +01:00
|
|
|
$table->cellspacing = 0;
|
|
|
|
$table->cellpadding = 0;
|
2015-03-06 12:28:05 +01:00
|
|
|
}
|
2019-01-30 16:18:44 +01:00
|
|
|
|
|
|
|
$table->data = [];
|
|
|
|
$table->head = [];
|
|
|
|
$table->style = [];
|
2015-03-06 12:28:05 +01:00
|
|
|
|
2015-07-07 13:57:47 +02:00
|
|
|
$table->style[0] = 'font-weight: bold';
|
|
|
|
$table->style[2] = 'font-weight: bold';
|
|
|
|
|
2009-05-20 16:19:38 +02:00
|
|
|
|
|
|
|
$table->data[0][0] = __('Type');
|
2019-01-30 16:18:44 +01:00
|
|
|
$table->data[0][1] = html_print_select(
|
|
|
|
alerts_get_alert_templates_types(),
|
|
|
|
'search_type',
|
|
|
|
$search_type,
|
|
|
|
'',
|
|
|
|
__('All'),
|
|
|
|
'',
|
|
|
|
true,
|
|
|
|
false,
|
|
|
|
false
|
|
|
|
);
|
2009-05-20 16:19:38 +02:00
|
|
|
$table->data[0][2] = __('Search');
|
2019-01-30 16:18:44 +01:00
|
|
|
$table->data[0][3] = html_print_input_text(
|
|
|
|
'search_string',
|
|
|
|
$search_string,
|
|
|
|
'',
|
|
|
|
25,
|
|
|
|
255,
|
|
|
|
true
|
|
|
|
);
|
2009-05-20 16:19:38 +02:00
|
|
|
$table->data[0][4] = '<div class="action-buttons">';
|
2019-01-30 16:18:44 +01:00
|
|
|
$table->data[0][4] .= html_print_submit_button(
|
|
|
|
__('Search'),
|
|
|
|
'',
|
|
|
|
false,
|
|
|
|
'class="sub search"',
|
|
|
|
true
|
|
|
|
);
|
2009-05-20 16:19:38 +02:00
|
|
|
$table->data[0][4] .= '</div>';
|
|
|
|
|
2020-07-13 12:23:46 +02:00
|
|
|
if (is_metaconsole() === true) {
|
2019-01-30 16:18:44 +01:00
|
|
|
$filter = '<form class="" method="post" action="'.$url.'">';
|
|
|
|
$filter .= html_print_table($table, true);
|
|
|
|
$filter .= '</form>';
|
|
|
|
ui_toggle($filter, __('Show Options'));
|
|
|
|
} else {
|
|
|
|
echo '<form method="post" action="'.$url.'">';
|
|
|
|
html_print_table($table);
|
|
|
|
echo '</form>';
|
|
|
|
}
|
|
|
|
|
|
|
|
unset($table);
|
|
|
|
|
|
|
|
$filter = [];
|
|
|
|
if ($search_type != '') {
|
|
|
|
$filter['type'] = $search_type;
|
2015-03-11 15:57:05 +01:00
|
|
|
}
|
2019-01-30 16:18:44 +01:00
|
|
|
|
|
|
|
if ($search_string) {
|
|
|
|
$filter[] = "(name LIKE '%".$search_string."%' OR description LIKE '%".$search_string."%' OR value LIKE '%".$search_string."%')";
|
2015-03-11 15:57:05 +01:00
|
|
|
}
|
2019-01-30 16:18:44 +01:00
|
|
|
|
|
|
|
$filter['offset'] = (int) get_parameter('offset');
|
2009-05-20 16:19:38 +02:00
|
|
|
$filter['limit'] = (int) $config['block_size'];
|
2019-01-30 16:18:44 +01:00
|
|
|
if (!is_user_admin($config['id_user'])) {
|
|
|
|
$filter['id_group'] = array_keys(users_get_groups(false, 'LM'));
|
|
|
|
}
|
|
|
|
|
2022-05-23 17:10:00 +02:00
|
|
|
$total_templates = alerts_get_alert_templates($filter, ['COUNT(*) AS total']);
|
|
|
|
$total_templates = $total_templates[0]['total'];
|
|
|
|
|
2019-01-30 16:18:44 +01:00
|
|
|
$templates = alerts_get_alert_templates(
|
|
|
|
$filter,
|
|
|
|
[
|
|
|
|
'id',
|
|
|
|
'name',
|
|
|
|
'description',
|
|
|
|
'type',
|
|
|
|
'id_group',
|
2020-07-07 11:05:19 +02:00
|
|
|
'previous_name',
|
2019-01-30 16:18:44 +01:00
|
|
|
]
|
|
|
|
);
|
|
|
|
if ($templates === false) {
|
|
|
|
$templates = [];
|
|
|
|
}
|
2013-02-27 17:53:14 +01:00
|
|
|
|
2015-06-25 10:07:53 +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';
|
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');
|
2010-02-25 20:17:59 +01:00
|
|
|
$table->head[1] = __('Group');
|
2019-01-30 16:18:44 +01:00
|
|
|
// $table->head[2] = __('Description');
|
2010-02-25 20:17:59 +01:00
|
|
|
$table->head[3] = __('Type');
|
|
|
|
$table->head[4] = __('Op.');
|
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 = [];
|
2019-04-08 11:31:27 +02:00
|
|
|
$table->size[4] = '85px';
|
2019-01-30 16:18:44 +01:00
|
|
|
$table->align = [];
|
2015-06-16 16:09:50 +02:00
|
|
|
$table->align[1] = 'left';
|
|
|
|
$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
|
|
|
|
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 ($templates as $template) {
|
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_template&id='.$template['id'].'&pure='.$pure.'">'.$template['name'].'</a>';
|
|
|
|
if (!check_acl_restricted_all($config['id_user'], $template['id_group'], 'LM')) {
|
|
|
|
$data[0] .= ui_print_help_tip(__('You cannot edit this alert template, You don\'t have the permission to edit All group.'), true);
|
2021-01-20 18:22:43 +01:00
|
|
|
}
|
2019-01-30 16:18:44 +01:00
|
|
|
|
|
|
|
$data[1] = ui_print_group_icon($template['id_group'], true);
|
|
|
|
$data[3] = alerts_get_alert_templates_type_name($template['type']);
|
|
|
|
|
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'], $template['id_group'], 'LM')
|
2020-07-13 12:23:46 +02:00
|
|
|
) {
|
2019-04-02 13:42:30 +02:00
|
|
|
$table->cellclass[][4] = 'action_buttons';
|
2021-03-11 15:40:23 +01:00
|
|
|
$data[4] = '<form method="post" action="index.php?sec='.$sec.'&sec2=godmode/alerts/configure_alert_template&pure='.$pure.'" class="float-left inline_line">';
|
2019-01-30 16:18:44 +01:00
|
|
|
$data[4] .= html_print_input_hidden('duplicate_template', 1, true);
|
|
|
|
$data[4] .= html_print_input_hidden('source_id', $template['id'], true);
|
2020-07-13 12:23:46 +02:00
|
|
|
$data[4] .= html_print_input_image(
|
|
|
|
'dup',
|
|
|
|
'images/copy.png',
|
|
|
|
1,
|
|
|
|
'',
|
|
|
|
true,
|
|
|
|
['title' => __('Duplicate')]
|
|
|
|
);
|
2019-01-30 16:18:44 +01:00
|
|
|
$data[4] .= '</form> ';
|
|
|
|
|
2021-03-26 09:11:10 +01:00
|
|
|
if (check_acl_restricted_all($config['id_user'], $template['id_group'], 'LM')) {
|
|
|
|
$data[4] .= '<form method="post" class="float-right inline_line" onsubmit="if (!confirm(\''.__('Are you sure?').'\')) return false;">';
|
|
|
|
$data[4] .= html_print_input_hidden('delete_template', 1, true);
|
|
|
|
$data[4] .= html_print_input_hidden('id', $template['id'], true);
|
|
|
|
$data[4] .= html_print_input_image(
|
|
|
|
'del',
|
|
|
|
'images/cross.png',
|
|
|
|
1,
|
|
|
|
'',
|
|
|
|
true,
|
|
|
|
['title' => __('Delete')]
|
|
|
|
);
|
|
|
|
$data[4] .= '</form> ';
|
|
|
|
}
|
2019-01-30 16:18:44 +01:00
|
|
|
} else {
|
|
|
|
$data[4] = '';
|
|
|
|
}
|
|
|
|
|
|
|
|
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
|
|
|
ui_pagination($total_templates, $url);
|
2020-07-13 12:23:46 +02:00
|
|
|
if (isset($data) === true) {
|
2019-01-30 16:18:44 +01:00
|
|
|
html_print_table($table);
|
2020-07-13 12:23:46 +02:00
|
|
|
ui_pagination(
|
|
|
|
$total_templates,
|
|
|
|
$url,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
false,
|
|
|
|
'offset',
|
|
|
|
true,
|
|
|
|
'pagination-bottom'
|
|
|
|
);
|
2019-01-30 16:18:44 +01:00
|
|
|
} else {
|
2020-07-13 12:23:46 +02:00
|
|
|
ui_print_info_message(
|
|
|
|
[
|
|
|
|
'no_close' => true,
|
|
|
|
'message' => __('No alert templates defined'),
|
|
|
|
]
|
|
|
|
);
|
2009-11-03 12:13:47 +01:00
|
|
|
}
|
2019-01-30 16:18:44 +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_template&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');
|