mirror of
https://github.com/moodle/moodle.git
synced 2025-01-29 11:46:19 +01:00
MDL-63264 enrol: retrieve additional welcome message contact data.
The `maildisplay` field is required to determine from whom to send the welcome message. Co-authored-by: Zak Risha <zjrisha@gmail.com>
This commit is contained in:
parent
485130d7c5
commit
88ef13a747
@ -3608,14 +3608,15 @@ abstract class enrol_plugin {
|
||||
$rusers = [];
|
||||
if (!empty($CFG->coursecontact)) {
|
||||
$croles = explode(',', $CFG->coursecontact);
|
||||
[$sort, $sortparams] = users_order_by_sql('u');
|
||||
[$sort] = users_order_by_sql('u');
|
||||
// We only use the first user.
|
||||
$i = 0;
|
||||
do {
|
||||
$userfieldsapi = \core_user\fields::for_name();
|
||||
$allnames = $userfieldsapi->get_sql('u', false, '', '', false)->selects;
|
||||
$rusers = get_role_users($croles[$i], $context, true, 'u.id, u.confirmed, u.username, '. $allnames . ',
|
||||
u.email, r.sortorder, ra.id AS raid', 'r.sortorder, ra.id ASC, ' . $sort, null, '', '', '', '', $sortparams);
|
||||
$rusers = get_role_users($croles[$i], $context, true,
|
||||
"u.id, u.confirmed, u.username, {$allnames}, u.email, u.maildisplay, r.sortorder, ra.id AS raid",
|
||||
"r.sortorder, ra.id ASC, {$sort}");
|
||||
$i++;
|
||||
} while (empty($rusers) && !empty($croles[$i]));
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user