MDL-21830 Prevent users from viewing names of all other site users - only teachers with role assign see the full name of not enrolled users when trying to access the profile

This commit is contained in:
Petr Skoda 2010-03-18 22:15:41 +00:00
parent 9707279af6
commit 871e5728e2

View File

@ -130,7 +130,7 @@ if (!$currentuser) {
}
if (!has_capability('moodle/course:view', $coursecontext, $user->id, false)) {
if (has_capability('moodle/course:view', $coursecontext)) {
if (has_capability('moodle/role:assign', $coursecontext)) {
$PAGE->navbar->add($fullname);
echo $OUTPUT->heading(get_string('notenrolled', $fullname));
} else {