MDL-17837 apply some limits to the dropdown of users in first instance.
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user