From: mjollnir_ Date: Thu, 20 Apr 2006 00:19:17 +0000 (+0000) Subject: assign admins page should respect MAX_USERS_PER_PAGE X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=60188cee2b5709bb4d8ba113c08d464542e7ffe1;p=moodle.git assign admins page should respect MAX_USERS_PER_PAGE --- diff --git a/admin/admin.html b/admin/admin.html index 5d37598c39..b9913fc059 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 8744c0a6dd..68568dff48 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 : "";