From e79859512f76f8f6266f9efbb7223ee920cee236 Mon Sep 17 00:00:00 2001 From: stronk7 Date: Wed, 14 Jan 2009 17:47:00 +0000 Subject: [PATCH] MDL-17837 apply some limits to the dropdown of users in first instance. --- course/report/log/lib.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/course/report/log/lib.php b/course/report/log/lib.php index 881897841bb..5953745a221 100644 --- a/course/report/log/lib.php +++ b/course/report/log/lib.php @@ -47,15 +47,20 @@ function print_mnet_log_selector_form($hostid, $course, $selecteduser=0, $select // Get all the possible users $users = array(); + // Define limitfrom and limitnum for queries below + // If $showusers is enabled... don't apply limitfrom and limitnum + $limitfrom = empty($showusers) ? 0 : ''; + $limitnum = empty($showusers) ? COURSE_MAX_USERS_PER_DROPDOWN + 1 : ''; + // If looking at a different host, we're interested in all our site users if ($hostid == $CFG->mnet_localhost_id && $course->id != SITEID) { if ($selectedgroup) { // If using a group, only get users in that group. - $courseusers = get_group_users($selectedgroup, 'u.lastname ASC', '', 'u.id, u.firstname, u.lastname, u.idnumber'); + $courseusers = get_group_users($selectedgroup, 'u.lastname ASC', '', 'u.id, u.firstname, u.lastname, u.idnumber', $limitfrom, $imitnum); } else { - $courseusers = get_course_users($course->id, '', '', 'u.id, u.firstname, u.lastname, u.idnumber'); + $courseusers = get_course_users($course->id, '', '', 'u.id, u.firstname, u.lastname, u.idnumber', $limitfrom, $limitnum); } } else { - $courseusers = get_site_users("u.lastaccess DESC", "u.id, u.firstname, u.lastname, u.idnumber"); + $courseusers = get_site_users("u.lastaccess DESC", "u.id, u.firstname, u.lastname, u.idnumber", '', $limitfrom, $limitnum); } if (count($courseusers) < COURSE_MAX_USERS_PER_DROPDOWN && !$showusers) {