mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 06:18:28 +01:00
Merge branch '44279-27' of git://github.com/samhemelryk/moodle
This commit is contained in:
commit
e848a930d2
@ -540,7 +540,7 @@ function user_get_user_details_courses($user) {
|
||||
} else {
|
||||
// Try through course profile.
|
||||
foreach ($courses as $course) {
|
||||
if ($can_view_user_details_cap($user, $course) || ($user->id == $USER->id) || has_coursecontact_role($user->id)) {
|
||||
if (can_view_user_details_cap($user, $course) || ($user->id == $USER->id) || has_coursecontact_role($user->id)) {
|
||||
$userdetails = user_get_user_details($user, $course);
|
||||
}
|
||||
}
|
||||
|
@ -341,6 +341,16 @@ class core_user_externallib_testcase extends externallib_advanced_testcase {
|
||||
|
||||
// Only the own $USER username should be returned
|
||||
$this->assertEquals(1, count($returnedusers));
|
||||
|
||||
// And finally test as one of the enrolled users.
|
||||
$this->setUser($user1);
|
||||
|
||||
// Call the external function.
|
||||
$returnedusers = core_user_external::get_users_by_field('username',
|
||||
array($USER->username, $user1->username, $user2->username));
|
||||
|
||||
// Only the own $USER username should be returned still.
|
||||
$this->assertEquals(1, count($returnedusers));
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user