Skip to content

Commit

Permalink
Merge branch '44279-27' of git://github.com/samhemelryk/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
Damyon Wiese committed Feb 24, 2014
2 parents e3eaf61 + 854859e commit e848a93
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion user/lib.php
Expand Up @@ -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);
}
}
Expand Down
10 changes: 10 additions & 0 deletions user/tests/externallib_test.php
Expand Up @@ -341,6 +341,16 @@ public function test_get_users_by_field() {

// 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));
}

/**
Expand Down

0 comments on commit e848a93

Please sign in to comment.