mirror of
https://github.com/moodle/moodle.git
synced 2025-08-07 01:46:45 +02:00
Merge branch 'w43_MDL-29982_m22_canaccess' of git://github.com/skodak/moodle
This commit is contained in:
commit
302f45e8de
3 changed files with 113 additions and 54 deletions
|
@ -8148,7 +8148,7 @@ function forum_get_posts_by_user($user, array $courses, $musthaveaccess = false,
|
|||
} else {
|
||||
// Check whether the current user is enrolled or has access to view the course
|
||||
// if they don't we immediately have a problem.
|
||||
if (!can_access_course($coursecontext)) {
|
||||
if (!can_access_course($course)) {
|
||||
if ($musthaveaccess) {
|
||||
print_error('errorenrolmentrequired', 'forum');
|
||||
}
|
||||
|
@ -8157,7 +8157,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($coursecontext, $user)) {
|
||||
if (!can_access_course($course, $user)) {
|
||||
if ($musthaveaccess) {
|
||||
print_error('notenrolled', 'forum');
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue