mirror of
https://github.com/moodle/moodle.git
synced 2025-02-13 12:34:28 +01:00
Merged bugfix for bug 4431 from stable
This commit is contained in:
parent
8321c7b1d5
commit
e6bacdc55c
@ -104,8 +104,8 @@
|
||||
}
|
||||
|
||||
//check if user can view this post
|
||||
if (!forum_user_can_view_post($parent)){
|
||||
error ('you can not view this post');
|
||||
if (!forum_user_can_view_post($parent,$course)){
|
||||
error('You do not have permissions to view this post');
|
||||
}
|
||||
|
||||
if (! $post = forum_get_post_full($parent)) {
|
||||
|
@ -2658,7 +2658,7 @@ function forum_user_can_post($forum, $user=NULL) {
|
||||
}
|
||||
|
||||
//checks to see if a user can view a particular post
|
||||
function forum_user_can_view_post($post, $user=NULL){
|
||||
function forum_user_can_view_post($post, $course, $user=NULL){
|
||||
|
||||
global $CFG, $USER;
|
||||
|
||||
@ -2684,7 +2684,9 @@ function forum_user_can_view_post($post, $user=NULL){
|
||||
}
|
||||
|
||||
//first of all, the user must be in this course
|
||||
if (!(isstudent($forumcourse->course) or isteacher($forumcourse->course))){
|
||||
if (!(isstudent($forumcourse->course) or
|
||||
isteacher($forumcourse->course) or
|
||||
(isguest() && $course->guest) )){
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user