From 317bf0da3d4e904395455d21db7b8b8e3011845b Mon Sep 17 00:00:00 2001
From: Marcos Alconada <marcos.alconada@artica.es>
Date: Thu, 15 Apr 2021 10:33:31 +0000
Subject: [PATCH] minnor error fixed

---
 .../godmode/alerts/alert_commands.php         | 30 ++++++++++++-------
 1 file changed, 20 insertions(+), 10 deletions(-)

diff --git a/pandora_console/godmode/alerts/alert_commands.php b/pandora_console/godmode/alerts/alert_commands.php
index da7bfee2e2..7fe93ebbdf 100644
--- a/pandora_console/godmode/alerts/alert_commands.php
+++ b/pandora_console/godmode/alerts/alert_commands.php
@@ -462,13 +462,16 @@ if (is_ajax()) {
 }
 
 // This check should be after ajax. Because, ajax will be called from configure_alert_action.
-if (!check_acl($config['id_user'], 0, 'PM') && !is_user_admin($config['id_user
-'])) {
+if (!check_acl($config['id_user'], 0, 'PM') && !is_user_admin(
+    $config['id_user
+']
+)
+) {
     echo "<div id='message_permissions'  title='".__('Permissions warning')."' s
 tyle='display:none;'>";
-    echo "<p style='text-align: center;font-weight: bold;'>".__('Command managem
-ent is limited to administrator users or user profiles with permissions over Pan
-dora FMS management').'</p>';
+    echo "<p style='text-align: center;font-weight: bold; margin: 15px'>".__(
+        'Command management is limited to administrator users or user profiles with permissions PM'
+    ).'</p>';
     echo '</div>';
 }
 
@@ -680,12 +683,19 @@ foreach ($commands as $command) {
 
     // (IMPORTANT, DO NOT CHANGE!) only users with permissions over "All" group have access to edition of commands belonging to "All" group.
     if ($is_central_policies_on_node === false && !$command['internal'] && check_acl_restricted_all($config['id_user'], $command['id_group'], 'LM')) {
-        $data['action'] = '<span class="inline_flex">';
-        $data['action'] .= '<a href="index.php?sec='.$sec.'&sec2=godmode/alerts/alert_commands&amp;copy_command=1&id='.$command['id'].'&pure='.$pure.'"
-			onClick="if (!confirm(\''.__('Are you sure?').'\')) return false;">'.html_print_image('images/copy.png', true, ['class' => 'invert_filter']).'</a>';
-        $data['action'] .= '<a href="index.php?sec='.$sec.'&sec2=godmode/alerts/alert_commands&delete_command=1&id='.$command['id'].'&pure='.$pure.'"
+        if (check_acl($config['id_user'], 0, 'PM') || is_user_admin(
+            $config['id_user
+            ']
+        )
+        ) {
+                    $data['action'] = '<span class="inline_flex">';
+            $data['action'] .= '<a href="index.php?sec='.$sec.'&sec2=godmode/alerts/alert_commands&amp;copy_command=1&id='.$command['id'].'&pure='.$pure.'"
+            onClick="if (!confirm(\''.__('Are you sure?').'\')) return false;">'.html_print_image('images/copy.png', true, ['class' => 'invert_filter']).'</a>';
+
+            $data['action'] .= '<a href="index.php?sec='.$sec.'&sec2=godmode/alerts/alert_commands&delete_command=1&id='.$command['id'].'&pure='.$pure.'"
 			onClick="if (!confirm(\''.__('Are you sure?').'\')) return false;">'.html_print_image('images/cross.png', true, ['class' => 'invert_filter']).'</a>';
-        $data['action'] .= '</span>';
+            $data['action'] .= '</span>';
+        }
     }
 
     array_push($table->data, $data);