diff --git a/admin/admin.html b/admin/admin.html
index 5d37598c399..b9913fc059b 100644
--- a/admin/admin.html
+++ b/admin/admin.html
@@ -62,11 +62,17 @@
echo "\n";
}
echo "\n";
- }
- if (!empty($users)) {
- foreach ($users as $user) {
- $fullname = fullname($user, true);
- echo "\n";
+ } else {
+ if ($usercount > MAX_USERS_PER_PAGE) {
+ echo ''."\n"
+ .''."\n";
+ } else {
+ if (!empty($users)) {
+ foreach ($users as $user) {
+ $fullname = fullname($user, true);
+ echo "\n";
+ }
+ }
}
}
?>
diff --git a/admin/admin.php b/admin/admin.php
index 8744c0a6dda..68568dff480 100644
--- a/admin/admin.php
+++ b/admin/admin.php
@@ -101,11 +101,18 @@
/// If no search results then get potential users excluding current admins
if (empty($searchusers)) {
- if (!$users = get_users(true, '', true, $adminlist, 'firstname ASC, lastname ASC', '', '',
- 0, 99999, 'id, firstname, lastname, email') ) {
- $users = array();
+
+ $usercount = get_users(false, '', true, $adminlist, 'firstname ASC, lastname ASC', '', '',
+ 0, 99999, 'id, firstname, lastname, email');
+
+ $users = array();
+
+ if ($usercount <= MAX_USERS_PER_PAGE) {
+ if (!$users = get_users(true, '', true, $adminlist, 'firstname ASC, lastname ASC', '', '',
+ 0, 99999, 'id, firstname, lastname, email') ) {
+ $users = array();
+ }
}
- $usercount = count($users);
}
$searchtext = (isset($frm->searchtext)) ? $frm->searchtext : "";