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
|
|
|
|
|
2009-06-08 20:21:21 +02:00
|
|
|
// Pandora FMS - http://pandorafms.com
|
|
|
|
// ==================================================
|
2010-03-02 18:19:44 +01:00
|
|
|
// Copyright (c) 2005-2010 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(
|
|
|
|
'ACL Violation',
|
|
|
|
'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);
|
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
|
|
|
|
2012-12-12 20:37:35 +01:00
|
|
|
if (defined('METACONSOLE')) {
|
2019-01-30 16:18:44 +01:00
|
|
|
$sec = 'advanced';
|
|
|
|
} else {
|
|
|
|
$sec = 'galertas';
|
2012-12-12 20:37:35 +01:00
|
|
|
}
|
2011-02-15 14:17:26 +01:00
|
|
|
|
2012-12-12 20:37:35 +01:00
|
|
|
// This prevents to duplicate the header in case delete_templete action is performed
|
|
|
|
if (!$delete_template) {
|
2019-01-30 16:18:44 +01:00
|
|
|
// Header
|
|
|
|
if (defined('METACONSOLE')) {
|
|
|
|
alerts_meta_print_header();
|
|
|
|
} else {
|
|
|
|
// ~ ui_print_page_header (__('Alerts')." » ". __('Alert templates'), "images/gm_alerts.png", false, "alerts_config", true);
|
|
|
|
ui_print_page_header(__('Alerts').' » '.__('Alert templates'), 'images/gm_alerts.png', false, '', true);
|
|
|
|
}
|
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 = [];
|
|
|
|
for ($i = 1; $i <= 10; $i++) {
|
|
|
|
$values['field'.$i] = (string) get_parameter('field'.$i);
|
|
|
|
$values['field'.$i.'_recovery'] = $recovery_notify ? (string) get_parameter('field'.$i.'_recovery') : '';
|
|
|
|
}
|
|
|
|
|
|
|
|
$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
|
|
|
}
|
|
|
|
|
2011-02-15 14:17:26 +01: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) {
|
|
|
|
// If user tries to delete a template with group=ALL then must have "PM" access privileges
|
|
|
|
if ($al_template['id_group'] == 0) {
|
|
|
|
if (! check_acl($config['id_user'], 0, 'PM')) {
|
|
|
|
db_pandora_audit(
|
|
|
|
'ACL Violation',
|
|
|
|
'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
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} //end if
|
|
|
|
else {
|
|
|
|
$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);
|
|
|
|
// Then template group have to be is his own groups
|
|
|
|
if ($is_in_group) {
|
|
|
|
if (defined('METACONSOLE')) {
|
|
|
|
alerts_meta_print_header();
|
|
|
|
} else {
|
|
|
|
ui_print_page_header(__('Alerts').' » '.__('Alert templates'), 'images/gm_alerts.png', false, 'alerts_config', true);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
db_pandora_audit(
|
|
|
|
'ACL Violation',
|
|
|
|
'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);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
$result = alerts_delete_alert_template($id);
|
|
|
|
|
|
|
|
if ($result) {
|
|
|
|
db_pandora_audit('Template alert management', 'Delete alert template #'.$id);
|
|
|
|
} else {
|
|
|
|
db_pandora_audit('Template alert management', 'Fail try to delete alert template #'.$id);
|
|
|
|
}
|
|
|
|
|
|
|
|
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
|
|
|
}
|
|
|
|
|
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,
|
|
|
|
]
|
|
|
|
);
|
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';
|
2019-01-30 16:18:44 +01:00
|
|
|
if (defined('METACONSOLE')) {
|
|
|
|
$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>';
|
|
|
|
|
2019-01-30 16:18:44 +01:00
|
|
|
if (defined('METACONSOLE')) {
|
|
|
|
$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
|
|
|
|
|
|
|
$total_templates = alerts_get_alert_templates($filter, ['COUNT(*) AS total']);
|
2009-05-20 16:19:38 +02:00
|
|
|
$total_templates = $total_templates[0]['total'];
|
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'));
|
|
|
|
}
|
|
|
|
|
|
|
|
$templates = alerts_get_alert_templates(
|
|
|
|
$filter,
|
|
|
|
[
|
|
|
|
'id',
|
|
|
|
'name',
|
|
|
|
'description',
|
|
|
|
'type',
|
|
|
|
'id_group',
|
|
|
|
]
|
|
|
|
);
|
|
|
|
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%';
|
|
|
|
$table->class = 'databox data';
|
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 = [];
|
2013-10-10 11:20:21 +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 = [];
|
|
|
|
|
|
|
|
$data[0] = '<a href="index.php?sec='.$sec.'&sec2=godmode/alerts/configure_alert_template&id='.$template['id'].'&pure='.$pure.'">'.$template['name'].'</a>';
|
|
|
|
|
|
|
|
$data[1] = ui_print_group_icon($template['id_group'], true);
|
|
|
|
$data[3] = alerts_get_alert_templates_type_name($template['type']);
|
|
|
|
|
|
|
|
if (check_acl($config['id_user'], $template['id_group'], 'LM')) {
|
|
|
|
$data[4] = '<form method="post" action="index.php?sec='.$sec.'&sec2=godmode/alerts/configure_alert_template&pure='.$pure.'" style="display: inline; float: left">';
|
|
|
|
$data[4] .= html_print_input_hidden('duplicate_template', 1, true);
|
|
|
|
$data[4] .= html_print_input_hidden('source_id', $template['id'], true);
|
|
|
|
$data[4] .= html_print_input_image('dup', 'images/copy.png', 1, '', true, ['title' => __('Duplicate')]);
|
|
|
|
$data[4] .= '</form> ';
|
|
|
|
|
|
|
|
$data[4] .= '<form method="post" style="display: inline; float: right" 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> ';
|
|
|
|
} 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);
|
2012-08-02 Miguel de Dios <miguel.dedios@artica.es>
* pandoradb_data.sql, pandoradb.data.postgreSQL.sql,
pandoradb.data.oracle.sql, include/functions_config.php: fixed the
"list_ACL_IPs_for_API" update.
* operation/events/events_marquee.php, godmode/setup/setup.php,
godmode/reporting/graph_builder.php,
godmode/reporting/map_builder.php, godmode/reporting/graphs.php,
godmode/reporting/visual_console_builder.wizard.php,
godmode/reporting/visual_console_builder.php,
godmode/alerts/configure_alert_compound.php,
godmode/alerts/alert_list.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_list.builder.php,
godmode/alerts/configure_alert_special_days.php,
include/functions_api.php, include/functions_ui.php,
include/functions_netflow.php, include/functions_alerts.php,
include/functions_menu.php, include/functions_messages.php: cleaned
source code style.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6846 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-08-03 14:48:09 +02:00
|
|
|
if (isset($data)) {
|
2019-01-30 16:18:44 +01:00
|
|
|
html_print_table($table);
|
|
|
|
} else {
|
|
|
|
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
|
|
|
|
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
|
|
|
echo '<div class="action-buttons" style="width: '.$table->width.'">';
|
2012-12-12 20:37:35 +01:00
|
|
|
echo '<form method="post" action="index.php?sec='.$sec.'&sec2=godmode/alerts/configure_alert_template&pure='.$pure.'">';
|
2019-01-30 16:18:44 +01:00
|
|
|
html_print_submit_button(__('Create'), 'create', false, 'class="sub next"');
|
|
|
|
html_print_input_hidden('create_alert', 1);
|
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
|
|
|
echo '</form>';
|
|
|
|
echo '</div>';
|
2013-05-20 10:42:02 +02:00
|
|
|
|
|
|
|
enterprise_hook('close_meta_frame');
|