From d539b935bcb31c076170ab22d8c201536e97ec91 Mon Sep 17 00:00:00 2001 From: "marcos.alconada" Date: Wed, 2 Oct 2019 11:27:52 +0200 Subject: [PATCH] fixed minor error --- pandora_console/operation/search_policies.getdata.php | 8 +++++++- pandora_console/operation/search_results.php | 2 +- pandora_console/operation/search_users.getdata.php | 4 ++++ pandora_console/operation/search_users.php | 2 +- 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/pandora_console/operation/search_policies.getdata.php b/pandora_console/operation/search_policies.getdata.php index 5186f1f0a9..1274b17076 100644 --- a/pandora_console/operation/search_policies.getdata.php +++ b/pandora_console/operation/search_policies.getdata.php @@ -18,6 +18,11 @@ enterprise_include_once('include/functions_policies.php'); $searchpolicies = check_acl($config['id_user'], 0, 'AW'); +if (!$searchpolicies) { + $totalPolicies = 0; + return; +} + $selectpolicieIDUp = ''; $selectpolicieIDDown = ''; $selectNameUp = ''; @@ -169,7 +174,7 @@ switch ($sortField) { break; } -if ($searchpolicies == 0) { +if ($searchpolicies) { /* We take the user groups to get policies that meet the requirements of the search and which the user have permission on this groups @@ -189,6 +194,7 @@ if ($searchpolicies == 0) { $policies = db_process_sql($sql); + if ($policies !== false) { $totalPolicies = count($policies); diff --git a/pandora_console/operation/search_results.php b/pandora_console/operation/search_results.php index 803a92cdd1..b856f5f14e 100644 --- a/pandora_console/operation/search_results.php +++ b/pandora_console/operation/search_results.php @@ -18,7 +18,7 @@ require_once $config['homedir'].'/include/functions_reporting.php'; enterprise_include('operation/reporting/custom_reporting.php'); $searchAgents = $searchAlerts = $searchModules = check_acl($config['id_user'], 0, 'AR'); -$searchUsers = $searchPolicies = check_acl($config['id_user'], 0, 'AW'); +$searchUsers = $searchPolicies = check_acl($config['id_user'], 0, 'AR'); $searchMaps = $searchReports = $searchGraphs = check_acl($config['id_user'], 0, 'IR'); $searchMain = true; $searchHelps = true; diff --git a/pandora_console/operation/search_users.getdata.php b/pandora_console/operation/search_users.getdata.php index a39cdf70f1..5e67c90059 100644 --- a/pandora_console/operation/search_users.getdata.php +++ b/pandora_console/operation/search_users.getdata.php @@ -18,6 +18,10 @@ require_once $config['homedir'].'/include/functions_users.php'; require_once $config['homedir'].'/include/functions_groups.php'; $searchUsers = check_acl($config['id_user'], 0, 'UM'); +if (!$searchUsers) { + $totalUsers = 0; + return; +} $selectUserIDUp = ''; $selectUserIDDown = ''; diff --git a/pandora_console/operation/search_users.php b/pandora_console/operation/search_users.php index 8014d5a261..b2232a44f9 100755 --- a/pandora_console/operation/search_users.php +++ b/pandora_console/operation/search_users.php @@ -91,7 +91,7 @@ if (!$users || !$searchUsers) { } echo '
'; - ui_pagination($totalUsers); + // ui_pagination($totalUsers); html_print_table($table); unset($table); ui_pagination($totalUsers);