mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
Merge branch 'MDL-59365-master-fix1' of http://github.com/damyon/moodle
This commit is contained in:
commit
f409b3984b
1 changed files with 5 additions and 1 deletions
|
@ -453,7 +453,11 @@ class core_enrol_external extends external_api {
|
|||
|
||||
$results = array();
|
||||
foreach ($users['users'] as $id => $user) {
|
||||
if ($userdetails = user_get_user_details($user)) {
|
||||
// Note: We pass the course here to validate that the current user can at least view user details in this course.
|
||||
// The user we are looking at is not in this course yet though - but we only fetch the minimal set of
|
||||
// user records, and the user has been validated to have course:enrolreview in this course. Otherwise
|
||||
// there is no way to find users who aren't in the course in order to enrol them.
|
||||
if ($userdetails = user_get_user_details($user, $course)) {
|
||||
$results[] = $userdetails;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue