mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 00:12:56 +02:00
MDL-22309 enrol_self: Fixing get_role_users usage
This commit is contained in:
parent
22645c9573
commit
bc92aace89
@ -432,7 +432,13 @@ class enrol_self_plugin extends enrol_plugin {
|
||||
if (!empty($CFG->coursecontact)) {
|
||||
$croles = explode(',', $CFG->coursecontact);
|
||||
list($sort, $sortparams) = users_order_by_sql('u');
|
||||
$rusers = get_role_users($croles, $context, true, '', 'r.sortorder ASC, ' . $sort, null, '', '', '', '', $sortparams);
|
||||
// We only use the first user.
|
||||
$i = 0;
|
||||
do {
|
||||
$rusers = get_role_users($croles[$i], $context, true, '',
|
||||
'r.sortorder ASC, ' . $sort, null, '', '', '', '', $sortparams);
|
||||
$i++;
|
||||
} while (empty($rusers) && !empty($croles[$i]));
|
||||
}
|
||||
if ($rusers) {
|
||||
$contact = reset($rusers);
|
||||
|
Loading…
x
Reference in New Issue
Block a user