mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
Merge branch 'MDL-38142-master' of git://github.com/FMCorz/moodle
This commit is contained in:
commit
99334f6a56
1 changed files with 1 additions and 1 deletions
|
@ -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');
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue