diff --git a/pandora_console/godmode/alerts/alert_actions.php b/pandora_console/godmode/alerts/alert_actions.php
index b0a88eeec0..793156457d 100644
--- a/pandora_console/godmode/alerts/alert_actions.php
+++ b/pandora_console/godmode/alerts/alert_actions.php
@@ -32,19 +32,6 @@ if (! check_acl($config['id_user'], 0, 'LM')) {
exit;
}
-if (is_ajax()) {
- $get_alert_action = (bool) get_parameter('get_alert_action');
- if ($get_alert_action) {
- $id = (int) get_parameter('id');
- $action = alerts_get_alert_action($id);
- $action['command'] = alerts_get_alert_action_alert_command($action['id']);
-
- echo json_encode($action);
- }
-
- return;
-}
-
$update_action = (bool) get_parameter('update_action');
$create_action = (bool) get_parameter('create_action');
$delete_action = (bool) get_parameter('delete_action');
@@ -57,15 +44,22 @@ if (defined('METACONSOLE')) {
$sec = 'galertas';
}
-if ((!$copy_action) && (!$delete_action)) {
- // Header
- if (defined('METACONSOLE')) {
- alerts_meta_print_header();
- } else {
- ui_print_page_header(__('Alerts').' » '.__('Alert actions'), 'images/gm_alerts.png', false, 'alerts_action', true);
- }
-}
+// Header.
+if (defined('METACONSOLE')) {
+ alerts_meta_print_header();
+} else {
+ $header_help = 'alerts_action';
+ if ($copy_action) {
+ $header_help = 'alerts_config';
+ }
+
+ if ($delete_action) {
+ $header_help = 'alerts_action';
+ }
+
+ ui_print_page_header(__('Alerts').' » '.__('Alert actions'), 'images/gm_alerts.png', false, $header_help, true);
+}
if ($copy_action) {
$id = get_parameter('id');
@@ -83,13 +77,6 @@ if ($copy_action) {
);
include 'general/noaccess.php';
exit;
- } else {
- // Header
- if (defined('METACONSOLE')) {
- alerts_meta_print_header();
- } else {
- ui_print_page_header(__('Alerts').' » '.__('Alert actions'), 'images/gm_alerts.png', false, 'alerts_config', true);
- }
}
} //end if
else {
@@ -102,14 +89,7 @@ if ($copy_action) {
$is_in_group = in_array($al_action['id_group'], $own_groups);
// Then action group have to be in his own groups
- if ($is_in_group) {
- // Header
- if (defined('METACONSOLE')) {
- alerts_meta_print_header();
- } else {
- ui_print_page_header(__('Alerts').' » '.__('Alert actions'), 'images/gm_alerts.png', false, 'alerts_config', true);
- }
- } else {
+ if (!$is_in_group) {
db_pandora_audit(
'ACL Violation',
'Trying to access Alert Management'
@@ -118,13 +98,6 @@ if ($copy_action) {
exit;
}
}
- } else {
- // Header
- if (defined('METACONSOLE')) {
- alerts_meta_print_header();
- } else {
- ui_print_page_header(__('Alerts').' » '.__('Alert actions'), 'images/gm_alerts.png', false, 'alerts_config', true);
- }
}
$result = alerts_clone_alert_action($id);
@@ -162,13 +135,6 @@ if ($delete_action) {
);
include 'general/noaccess.php';
exit;
- } else {
- // Header
- if (defined('METACONSOLE')) {
- alerts_meta_print_header();
- } else {
- ui_print_page_header(__('Alerts').' » '.__('Alert actions'), 'images/gm_alerts.png', false, 'alert_action', true);
- }
}
// If user tries to delete an action of others groups
@@ -182,14 +148,7 @@ if ($delete_action) {
$is_in_group = in_array($al_action['id_group'], $own_groups);
// Then action group have to be in his own groups
- if ($is_in_group) {
- // Header
- if (defined('METACONSOLE')) {
- alerts_meta_print_header();
- } else {
- ui_print_page_header(__('Alerts').' » '.__('Alert actions'), 'images/gm_alerts.png', false, 'alert_action', true);
- }
- } else {
+ if (!$is_in_group) {
db_pandora_audit(
'ACL Violation',
'Trying to access Alert Management'
@@ -198,9 +157,6 @@ if ($delete_action) {
exit;
}
}
- } else {
- // Header
- ui_print_page_header(__('Alerts').' » '.__('Alert actions'), 'images/gm_alerts.png', false, '', true);
}
@@ -285,10 +241,14 @@ foreach ($actions as $action) {
2 => 'action_buttons',
3 => 'action_buttons',
];
- $data[2] = ''.html_print_image('images/copy.png', true).'';
- $data[3] = ''.html_print_image('images/cross.png', true).'';
+
+ $id_action = $action['id'];
+ $text_confirm = __('Are you sure?');
+
+ $data[2] = ''.html_print_image('images/copy.png', true).'';
+ $data[3] = ''.html_print_image('images/cross.png', true).'';
}
array_push($table->data, $data);
@@ -308,3 +268,45 @@ echo '';
echo '';
enterprise_hook('close_meta_frame');
+?>
+
+
+