From 9603f904015d834257725c0a4eab8ffb325883a2 Mon Sep 17 00:00:00 2001 From: Pablo Aragon Date: Thu, 31 Aug 2023 12:23:46 +0200 Subject: [PATCH] 11839-Add check global_block_size --- .../include/class/ConsoleSupervisor.php | 64 +++++++++++-------- pandora_console/include/functions_config.php | 4 ++ 2 files changed, 43 insertions(+), 25 deletions(-) diff --git a/pandora_console/include/class/ConsoleSupervisor.php b/pandora_console/include/class/ConsoleSupervisor.php index f6d3767708..4d7a6435e9 100644 --- a/pandora_console/include/class/ConsoleSupervisor.php +++ b/pandora_console/include/class/ConsoleSupervisor.php @@ -621,7 +621,8 @@ class ConsoleSupervisor 'small_operation_step_datos_purge' => 'Small Operation Step to purge old data', 'row_limit_csv' => 'Row limit in csv log', 'limit_parameters_massive' => 'Limit for bulk operations', - 'block_size' => 'Block size for pagination', + 'block_size' => 'User block size for pagination', + 'global_block_size' => 'Global block size for pagination', 'short_module_graph_data' => 'Data precision', 'graph_precision' => 'Data precision in graphs', ]; @@ -635,8 +636,14 @@ class ConsoleSupervisor $message = ''; $limit_value = ''; + $url = ''; if ($config[$variable] > $values->max) { $message = 'Check the setting of %s, a value greater than %s is not recommended'; + + if ($variable === 'block_size') { + $message .= '. (User: '.$config['id_user'].')'; + } + $limit_value = $values->max; } @@ -647,32 +654,39 @@ class ConsoleSupervisor if ($limit_value !== '' && $message !== '') { if (is_metaconsole() === true) { - $this->notify( - [ - 'type' => 'NOTIF.VARIABLES.PERFORMANCE.'.$variable, - 'title' => __('Incorrect config value'), - 'message' => __( - $message, - $names[$variable], - $limit_value - ), - 'url' => '__url__index.php?sec=advanced&sec2=advanced/metasetup', - ] - ); + $url = '__url__index.php?sec=advanced&sec2=advanced/metasetup'; } else { - $this->notify( - [ - 'type' => 'NOTIF.VARIABLES.PERFORMANCE.'.$variable, - 'title' => __('Incorrect config value'), - 'message' => __( - $message, - $names[$variable], - $limit_value - ), - 'url' => '__url__/index.php?sec=general&sec2=godmode/setup/setup', - ] - ); + $url = '__url__/index.php?sec=general&sec2=godmode/setup/setup'; } + + if ($variable === 'block_size') { + if (is_metaconsole() === true) { + $url = '__url__index.php?sec=gusuarios&sec2=godmode/users/configure_user&edit_user=1&pure=0&id_user='.$config['id_user']; + } else { + $url = '__url__/index.php?sec=gusuarios&sec2=godmode/users/configure_user&edit_user=1&pure=0&id_user='.$config['id_user']; + } + } + + if ($variable === 'global_block_size') { + if (is_metaconsole() === true) { + $url = '__url__index.php?sec=advanced&sec2=advanced/metasetup&pure=0&tab=visual'; + } else { + $url = '__url__/index.php?sec=gsetup&sec2=godmode/setup/setup§ion=vis'; + } + } + + $this->notify( + [ + 'type' => 'NOTIF.VARIABLES.PERFORMANCE.'.$variable, + 'title' => __('Incorrect config value'), + 'message' => __( + $message, + $names[$variable], + $limit_value + ), + 'url' => $url, + ] + ); } } diff --git a/pandora_console/include/functions_config.php b/pandora_console/include/functions_config.php index 033b2067b6..8401fb8ec2 100644 --- a/pandora_console/include/functions_config.php +++ b/pandora_console/include/functions_config.php @@ -2561,6 +2561,10 @@ function config_process_config() 'max' => 200, 'min' => 10, ], + 'global_block_size' => [ + 'max' => 200, + 'min' => 10, + ], 'short_module_graph_data' => [ 'max' => 20, 'min' => 1,