From c48627cf9ab638b49f43443d1c130d7f809bcf49 Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Fri, 3 May 2024 12:03:21 +0200 Subject: [PATCH 1/4] #13603 fixed acl --- .../include/ajax/task_to_perform.php | 5 +++++ .../include/class/WelcomeWindow.class.php | 20 +++++++++++++------ 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/pandora_console/include/ajax/task_to_perform.php b/pandora_console/include/ajax/task_to_perform.php index 331f1be199..c7a9e1bcca 100644 --- a/pandora_console/include/ajax/task_to_perform.php +++ b/pandora_console/include/ajax/task_to_perform.php @@ -145,6 +145,11 @@ if ($create_net_scan) { } if ($create_mail_alert) { + if ((bool) check_acl($config['id_user'], 0, 'LM') === false) { + ui_print_error_message(__('Unauthorized')); + return; + } + include_once '../functions_alerts.php'; $id_action = db_get_row_filter('talert_actions', ['name' => 'Email to '.$config['id_user']], 'id')['id']; if (!$id_action) { diff --git a/pandora_console/include/class/WelcomeWindow.class.php b/pandora_console/include/class/WelcomeWindow.class.php index 2c37f1150e..5f2efd4f40 100644 --- a/pandora_console/include/class/WelcomeWindow.class.php +++ b/pandora_console/include/class/WelcomeWindow.class.php @@ -610,12 +610,20 @@ class WelcomeWindow extends Wizard ], ]; - $fields['load_demo_data'] = __('Load demo data'); - $fields['wizard_agent'] = __('Agent installation wizard'); - $fields['check_web'] = __('Create WEB monitoring'); - $fields['check_connectivity'] = __('Create network monitoring'); - $fields['check_net'] = __('Discover my network'); - $fields['check_mail_alert'] = __('Create email alert'); + if (users_is_admin() === true) { + $fields['load_demo_data'] = __('Load demo data'); + } + + if ((bool) check_acl($config['id_user'], 0, 'AW') === true) { + $fields['wizard_agent'] = __('Agent installation wizard'); + $fields['check_web'] = __('Create WEB monitoring'); + $fields['check_connectivity'] = __('Create network monitoring'); + $fields['check_net'] = __('Discover my network'); + } + + if ((bool) check_acl($config['id_user'], 0, 'LM') === true) { + $fields['check_mail_alert'] = __('Create email alert'); + } $inputs[] = [ 'wrapper' => 'div', From 2cf329b0a3b40219e6f2979c3398598b7a1591de Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Wed, 8 May 2024 14:09:49 +0200 Subject: [PATCH 2/4] #13603 added message in welcome modal for user not pm --- .../include/class/WelcomeWindow.class.php | 26 ++++++++++++++++--- pandora_console/include/styles/pandora.css | 11 ++++++++ 2 files changed, 34 insertions(+), 3 deletions(-) diff --git a/pandora_console/include/class/WelcomeWindow.class.php b/pandora_console/include/class/WelcomeWindow.class.php index 5f2efd4f40..085ea5fdc2 100644 --- a/pandora_console/include/class/WelcomeWindow.class.php +++ b/pandora_console/include/class/WelcomeWindow.class.php @@ -378,6 +378,8 @@ class WelcomeWindow extends Wizard 'class' => 'modal', ]; + $output = ''; + if (check_acl($config['id_user'], 0, 'PM')) { $flag_um = false; $flag_cm = false; @@ -590,6 +592,18 @@ class WelcomeWindow extends Wizard if ($flag_um === false || $flag_cm === false || $flag_su === false || $flag_lv === false) { $flag_task = true; } + } else { + $output .= html_print_div( + [ + 'class' => 'flex-column-start welcome-message-no-pm', + 'content' => ' +

'._('Hi!').'

+

'.__('It seems you are new to Pandora FMS.').'
+ '.__('If you want to watch videos on how to use Pandora FMS, you can visit our ').''.__('YouTube channel.').'

+

'.__('Are you familiar with ').''.__('our eLearning system?').''._(' It\'s completely free for PAO (Operation) and PAT (Administration) courses. Learn how to use Pandora FMS at your own pace.').'

', + ], + true + ); } // Task to do. @@ -657,10 +671,16 @@ class WelcomeWindow extends Wizard ], ]; - $output = $this->printForm( + $output = html_print_div( [ - 'form' => $form, - 'inputs' => $inputs, + 'content' => $output.$this->printForm( + [ + 'form' => $form, + 'inputs' => $inputs, + ], + true + ), + 'class' => 'column-left w50p', ], true ); diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css index 8e340928f7..1efcae79ae 100644 --- a/pandora_console/include/styles/pandora.css +++ b/pandora_console/include/styles/pandora.css @@ -14315,3 +14315,14 @@ div.fixed-bottom-box.tree-view-bottom-modal { .bg-image-none { background-image: none !important; } +.welcome-message-no-pm h2 { + font-size: 20px !important; + margin: 0px; +} +.welcome-message-no-pm p, +.welcome-message-no-pm b { + font-size: 15px !important; +} +.welcome-message-no-pm { + margin-bottom: 30px; +} From 1aee7a3102a0207ca3f5d472b6d9ebe8eaf6d1ef Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Wed, 8 May 2024 15:17:50 +0200 Subject: [PATCH 3/4] #13603 fixed translate --- pandora_console/include/class/WelcomeWindow.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/include/class/WelcomeWindow.class.php b/pandora_console/include/class/WelcomeWindow.class.php index 085ea5fdc2..d30b7b3715 100644 --- a/pandora_console/include/class/WelcomeWindow.class.php +++ b/pandora_console/include/class/WelcomeWindow.class.php @@ -597,7 +597,7 @@ class WelcomeWindow extends Wizard [ 'class' => 'flex-column-start welcome-message-no-pm', 'content' => ' -

'._('Hi!').'

+

'.__('Hi!').'

'.__('It seems you are new to Pandora FMS.').'
'.__('If you want to watch videos on how to use Pandora FMS, you can visit our ').''.__('YouTube channel.').'

'.__('Are you familiar with ').''.__('our eLearning system?').''._(' It\'s completely free for PAO (Operation) and PAT (Administration) courses. Learn how to use Pandora FMS at your own pace.').'

', From 938249b6a2222b15516ba01d66e3a750832355f8 Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Wed, 8 May 2024 15:20:58 +0200 Subject: [PATCH 4/4] #13603 fixed translate --- pandora_console/include/class/WelcomeWindow.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/include/class/WelcomeWindow.class.php b/pandora_console/include/class/WelcomeWindow.class.php index d30b7b3715..ea1e4db80e 100644 --- a/pandora_console/include/class/WelcomeWindow.class.php +++ b/pandora_console/include/class/WelcomeWindow.class.php @@ -600,7 +600,7 @@ class WelcomeWindow extends Wizard

'.__('Hi!').'

'.__('It seems you are new to Pandora FMS.').'
'.__('If you want to watch videos on how to use Pandora FMS, you can visit our ').''.__('YouTube channel.').'

-

'.__('Are you familiar with ').''.__('our eLearning system?').''._(' It\'s completely free for PAO (Operation) and PAT (Administration) courses. Learn how to use Pandora FMS at your own pace.').'

', +

'.__('Are you familiar with ').''.__('our eLearning system?').''.__(' It\'s completely free for PAO (Operation) and PAT (Administration) courses. Learn how to use Pandora FMS at your own pace.').'

', ], true );