From b877758d3ff9dbfba29069c754e6f4ee1c5977f5 Mon Sep 17 00:00:00 2001 From: Jorge Rincon Date: Mon, 6 May 2024 09:47:26 +0200 Subject: [PATCH 1/2] #13283 fixed permissions on custom graphs buttons --- pandora_console/godmode/reporting/graphs.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/godmode/reporting/graphs.php b/pandora_console/godmode/reporting/graphs.php index e072b0f28a..5e9676054a 100644 --- a/pandora_console/godmode/reporting/graphs.php +++ b/pandora_console/godmode/reporting/graphs.php @@ -481,7 +481,7 @@ if (!empty($graphs)) { $ActionButtons[] = ''; } - if (!empty($result_graphs)) { + if (!empty($result_graphs) && ($report_w || $report_m)) { $ActionButtons[] = "
"; $ActionButtons[] = html_print_input_hidden('multiple_delete', 1, true); $ActionButtons[] = html_print_submit_button( From d72b72758ddc141aa6392e77fa520e4a314754de Mon Sep 17 00:00:00 2001 From: Jorge Rincon Date: Thu, 9 May 2024 09:22:54 +0200 Subject: [PATCH 2/2] #13283 Permission is added for the button when there is no custom graph --- .../general/first_task/custom_graphs.php | 24 +++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/pandora_console/general/first_task/custom_graphs.php b/pandora_console/general/first_task/custom_graphs.php index aba2e72ee2..1e0c98dcbd 100644 --- a/pandora_console/general/first_task/custom_graphs.php +++ b/pandora_console/general/first_task/custom_graphs.php @@ -22,14 +22,18 @@ $msg = __( $msg .= '

'.__("There are two types of graphs: The agent's automated graphs and the graphs the user customizes by using one or more modules to do so."); - $url_new = 'index.php?sec=reporting&sec2=godmode/reporting/graph_builder'; - $button = ' - - '; +$button = ''; - echo ui_print_empty_view( - __('Create custom graph'), - $msg, - 'custom-graph.svg', - $button - ); +if (check_acl($config['id_user'], 0, 'RW') || check_acl($config['id_user'], 0, 'RM')) { + $url_new = 'index.php?sec=reporting&sec2=godmode/reporting/graph_builder'; + $button = '
+ +
'; +} + +echo ui_print_empty_view( + __('Create custom graph'), + $msg, + 'custom-graph.svg', + $button +);