mirror of
https://github.com/moodle/moodle.git
synced 2025-04-13 12:32:08 +02:00
MDL-59365 enrol: Teachers can see other users on the site
In order to enrol new users into a course, you need to see users who are not in the current course.
This commit is contained in:
parent
bd5416aab5
commit
2cc2001bef
@ -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…
x
Reference in New Issue
Block a user