mirror of
https://github.com/moodle/moodle.git
synced 2025-04-22 08:55:15 +02:00
get_role_users() can now get all the people who have any role in that context,
which is useful
This commit is contained in:
parent
a971a5985a
commit
b16de84980
@ -2795,12 +2795,17 @@ function get_role_users($roleid, $context, $parent=false, $fields='u.*', $sort='
|
||||
$parentcontexts = '';
|
||||
}
|
||||
|
||||
if ($roleid) {
|
||||
$roleselect = "AND r.roleid = $roleid";
|
||||
} else {
|
||||
$roleselect = '';
|
||||
}
|
||||
|
||||
$SQL = "SELECT $fields
|
||||
FROM {$CFG->prefix}role_assignments r,
|
||||
{$CFG->prefix}user u
|
||||
WHERE (r.contextid = $context->id $parentcontexts)
|
||||
AND r.roleid = $roleid
|
||||
AND u.id = r.userid
|
||||
AND u.id = r.userid $roleselect
|
||||
ORDER BY $sort
|
||||
"; // join now so that we can just use fullname() later
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user