MDL-58953 user: fix course checking logic in user_can_view_profile()
authorJake Dallimore <jake@moodle.com>
Tue, 29 Aug 2017 02:38:44 +0000 (10:38 +0800)
committerDavid Monllao <davidm@moodle.com>
Thu, 7 Sep 2017 08:53:33 +0000 (10:53 +0200)
commiteb01e70b9187fb0d68148babeee78d5ef05ed9b5
treea745c7dd5a971231a9fd2e7d4c6339cd6724663a
parent35b9bca0ca4ac8ec4fb6a590052112bd9f75ef33
MDL-58953 user: fix course checking logic in user_can_view_profile()

Make sure to check that $user in enrolled in $course before checking
whether the current user has capabilities in that course, and make sure
that we don't check user context caps when handling a specific course.
user/lib.php