Merge branch 'MDL-38142-28' of git://github.com/FMCorz/moodle into MOODLE_28_STABLE

This commit is contained in:
Andrew Nicols
2015-01-12 11:56:30 +08:00
+1 -1
View File
@@ -7416,7 +7416,7 @@ function forum_get_posts_by_user($user, array $courses, $musthaveaccess = false,
// Check whether the requested user is enrolled or has access to view the course
// if they don't we immediately have a problem.
if (!can_access_course($course, $user)) {
if (!can_access_course($course, $user) && !is_enrolled($coursecontext, $user)) {
if ($musthaveaccess) {
print_error('notenrolled', 'forum');
}