From 16958860148e64d19db5ae7d2af8bc35431df6ec Mon Sep 17 00:00:00 2001 From: Pablo Aragon Date: Tue, 7 May 2024 15:42:12 +0200 Subject: [PATCH] 13293-Fix ACL in Discovery view --- .../wizards/ManageExtensions.class.php | 142 ++++++++++-------- pandora_console/include/styles/pandora.css | 4 + 2 files changed, 84 insertions(+), 62 deletions(-) diff --git a/pandora_console/godmode/wizards/ManageExtensions.class.php b/pandora_console/godmode/wizards/ManageExtensions.class.php index 856a53a04a..a1baba90bc 100644 --- a/pandora_console/godmode/wizards/ManageExtensions.class.php +++ b/pandora_console/godmode/wizards/ManageExtensions.class.php @@ -160,6 +160,16 @@ class ManageExtensions extends HTML public function run() { global $config; + + if (! check_acl($config['id_user'], 0, 'AR')) { + db_pandora_audit( + AUDIT_LOG_ACL_VIOLATION, + 'Trying to access Manage disco packages' + ); + include 'general/noaccess.php'; + return; + } + // Load styles. parent::run(); @@ -278,52 +288,54 @@ class ManageExtensions extends HTML $this->printHeader(true) ); - $table = new stdClass(); - $table->width = '100%'; - $table->class = 'databox filters'; - $table->size = []; - $table->size[0] = '80%'; - $table->align[3] = 'right'; - $table->data = []; - $table->data[0][0] = html_print_label_input_block( - __('Load DISCO'), - html_print_div( + if ((bool) check_acl($config['id_user'], 0, 'AW') === true) { + $table = new stdClass(); + $table->width = '100%'; + $table->class = 'databox filters'; + $table->size = []; + $table->size[0] = '80%'; + $table->align[3] = 'right'; + $table->data = []; + $table->data[0][0] = html_print_label_input_block( + __('Load DISCO'), + html_print_div( + [ + 'id' => 'upload_file', + 'content' => html_print_input_file( + 'file', + true, + ['style' => 'width:100%'] + ), + 'class' => 'mrgn_top_15px', + ], + true + ) + ); + $table->data[0][3] = html_print_submit_button( + __('Upload DISCO'), + 'upload_button', + false, [ - 'id' => 'upload_file', - 'content' => html_print_input_file( - 'file', - true, - ['style' => 'width:100%'] - ), - 'class' => 'mrgn_top_15px', + 'class' => 'sub ok float-right', + 'icon' => 'next', ], true - ) - ); - $table->data[0][3] = html_print_submit_button( - __('Upload DISCO'), - 'upload_button', - false, - [ - 'class' => 'sub ok float-right', - 'icon' => 'next', - ], - true - ); + ); - echo '
'; - html_print_input_hidden('upload_disco', 1); - html_print_table($table); - // Auxiliar div ant string for migrate modal. - $modal = ''; - $modal .= ''; + echo ''; + html_print_input_hidden('upload_disco', 1); + html_print_table($table); + // Auxiliar div ant string for migrate modal. + $modal = ''; + $modal .= ''; - echo $modal; + echo $modal; - echo '
'; + echo '
'; - echo '
'; - echo ''; + echo '
'; + echo ''; + } echo '