From 740a3b6d3ea6aec8d3c4bda3d0582e73b33e6e0e Mon Sep 17 00:00:00 2001 From: Junichi Satoh Date: Wed, 2 Jun 2021 15:25:33 +0900 Subject: [PATCH] Fixed following problems. - csv export of custom report with custom graph did not work correctly. - number of users in default login screen was not correct with restricted user login. --- pandora_console/include/functions_modules.php | 3 +++ pandora_console/include/functions_reporting.php | 12 +++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/pandora_console/include/functions_modules.php b/pandora_console/include/functions_modules.php index 1a7548174b..cee8712b2e 100755 --- a/pandora_console/include/functions_modules.php +++ b/pandora_console/include/functions_modules.php @@ -2272,12 +2272,14 @@ function modules_get_agentmodule_data( $module_name = modules_get_agentmodule_name($id_agent_module); $agent_id = modules_get_agentmodule_agent($id_agent_module); $agent_name = modules_get_agentmodule_agent_name($id_agent_module); + $agent_alias = modules_get_agentmodule_agent_alias($id_agent_module); $module_type = modules_get_agentmodule_type($id_agent_module); foreach ($values as $key => $data) { $values[$key]['module_name'] = $module_name; $values[$key]['agent_id'] = $agent_id; $values[$key]['agent_name'] = $agent_name; + $values[$key]['agent_alias'] = $agent_alias; $values[$key]['module_type'] = $module_type; } @@ -2295,6 +2297,7 @@ function modules_get_agentmodule_data( 'module_name' => $values[$key]['module_name'], 'agent_id' => $values[$key]['agent_id'], 'agent_name' => $values[$key]['agent_name'], + 'agent_alias' => $values[$key]['agent_alias'], 'module_type' => $values[$key]['module_type'], ]; } diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index 0842cff2bd..e4c1373c50 100755 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -9060,8 +9060,8 @@ function reporting_custom_graph( case 'data': $data = []; foreach ($modules as $key => $value) { - $data[$value] = modules_get_agentmodule_data( - $value, + $data[$value['module']] = modules_get_agentmodule_data( + $value['module'], $content['period'], $report['datetime'] ); @@ -10557,7 +10557,13 @@ function reporting_get_stats_users($data) $tdata = []; $tdata[0] = html_print_image('images/user.png', true, ['title' => __('Defined users'), 'class' => 'invert_filter']); - $tdata[1] = count(get_users()); + $user_groups = users_get_strict_mode_groups($config['id_user'], false); + if (array_key_exists(0, $user_groups)) { + $users = users_get_user_users($config['id_user'], 'AR', true); + } else { + $users = users_get_user_users($config['id_user'], 'AR', false); + } + $tdata[1] = count($users); $tdata[1] = ''.$tdata[1].''; $tdata[2] = $tdata[3] = ' ';