mirror of
https://github.com/moodle/moodle.git
synced 2025-03-14 04:30:15 +01:00
Merge branch 'MDL-59826-master' of https://github.com/snake/moodle
This commit is contained in:
commit
4508e143d8
@ -4185,12 +4185,12 @@ EOD;
|
||||
}
|
||||
|
||||
// Only provide user information if the user is the current user, or a user which the current user can view.
|
||||
$canviewdetails = false;
|
||||
if ($user->id == $USER->id || user_can_view_profile($user)) {
|
||||
$canviewdetails = true;
|
||||
}
|
||||
// When checking user_can_view_profile(), either:
|
||||
// If the page context is course, check the course context (from the page object) or;
|
||||
// If page context is NOT course, then check across all courses.
|
||||
$course = ($this->page->context->contextlevel == CONTEXT_COURSE) ? $this->page->course : null;
|
||||
|
||||
if ($canviewdetails) {
|
||||
if (user_can_view_profile($user, $course)) {
|
||||
// Use the user's full name if the heading isn't set.
|
||||
if (!isset($heading)) {
|
||||
$heading = fullname($user);
|
||||
|
Loading…
x
Reference in New Issue
Block a user