mirror of
https://github.com/moodle/moodle.git
synced 2025-08-07 01:46:45 +02:00
MDL-11064, users can't see teacher's profile
This commit is contained in:
parent
6673f18b1c
commit
41fe0508eb
1 changed files with 6 additions and 7 deletions
|
@ -43,13 +43,6 @@
|
||||||
require_login($course->id);
|
require_login($course->id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// make sure user can view this student's profile
|
|
||||||
if ($USER->id != $user->id
|
|
||||||
&& !has_capability('moodle/user:viewdetails', $coursecontext)
|
|
||||||
&& !has_capability('moodle/user:viewdetails', $usercontext)) {
|
|
||||||
print_error('cannotviewprofile');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!empty($CFG->forceloginforprofiles)) {
|
if (!empty($CFG->forceloginforprofiles)) {
|
||||||
require_login();
|
require_login();
|
||||||
|
@ -77,6 +70,12 @@
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
} else { // Normal course
|
} else { // Normal course
|
||||||
|
// check capabilities
|
||||||
|
if (!has_capability('moodle/user:viewdetails', $coursecontext) &&
|
||||||
|
!has_capability('moodle/user:viewdetails', $usercontext)) {
|
||||||
|
print_error('cannotviewprofile');
|
||||||
|
}
|
||||||
|
|
||||||
if (!has_capability('moodle/course:view', $coursecontext, $user->id, false)) {
|
if (!has_capability('moodle/course:view', $coursecontext, $user->id, false)) {
|
||||||
if (has_capability('moodle/course:view', $coursecontext)) {
|
if (has_capability('moodle/course:view', $coursecontext)) {
|
||||||
print_header("$strpersonalprofile: ", "$strpersonalprofile: ",
|
print_header("$strpersonalprofile: ", "$strpersonalprofile: ",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue