From: toyomoyo Date: Mon, 12 Mar 2007 01:22:25 +0000 (+0000) Subject: merged fix for parent forloginforprofile problem X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=8308419e76b1c76acb8108c123d2fa3999cdeb68;p=moodle.git merged fix for parent forloginforprofile problem --- diff --git a/user/view.php b/user/view.php index 9ee7053a12..f3db2b96e2 100644 --- a/user/view.php +++ b/user/view.php @@ -44,8 +44,8 @@ } // 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)) + if ($USER->id != $user->id + && !has_capability('moodle/user:viewdetails', $coursecontext) && !has_capability('moodle/user:viewdetails', $usercontext)) { error('You can not view the profile of this user'); } @@ -66,9 +66,8 @@ /// If the user being shown is not ourselves, then make sure we are allowed to see them! if (!$currentuser) { - if ($course->id == SITEID) { // Reduce possibility of "browsing" userbase at site level - if ($CFG->forceloginforprofiles and !isteacherinanycourse() and !isteacherinanycourse($user->id)) { // Teachers can browse and be browsed at site level. If not forceloginforprofiles, allow access (bug #4366) + if ($CFG->forceloginforprofiles and !isteacherinanycourse() and !isteacherinanycourse($user->id) and !has_capability('moodle/user:viewdetails', $usercontext)) { // Teachers can browse and be browsed at site level. If not forceloginforprofiles, allow access (bug #4366) print_header("$strpersonalprofile: ", "$strpersonalprofile: ", "id\">$strparticipants -> $struser", "", "", true, " ", navmenu($course));