Permalink
Browse files

Further fixes to the fix for bug 4431, to allow guests to see posts

  • Loading branch information...
moodler
moodler committed Dec 22, 2005
1 parent 0731d9c commit acd04dd6cc6e1c82cd8e1751ce37e05cc98c4755
Showing with 6 additions and 4 deletions.
  1. +2 −2 mod/forum/discuss.php
  2. +4 −2 mod/forum/lib.php
View
@@ -96,8 +96,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)) {
View
@@ -2555,7 +2555,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;
@@ -2581,7 +2581,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;
}

0 comments on commit acd04dd

Please sign in to comment.