Adding if statement to verify whether user can see postings or not (Bug #4431)

This commit is contained in:
moodler 2005-12-08 05:01:57 +00:00
parent fa7be56710
commit d0087b2f5c

View File

@ -146,6 +146,8 @@
$groupmode = groupmode($course, $cm); $groupmode = groupmode($course, $cm);
} }
if ($groupmode and !isteacheredit($course->id)) { // Groups must be kept separate if ($groupmode and !isteacheredit($course->id)) { // Groups must be kept separate
//change this to ismember //change this to ismember
$mygroupid = mygroupid($course->id);//only useful if 0, otherwise it's an array now $mygroupid = mygroupid($course->id);//only useful if 0, otherwise it's an array now
@ -167,6 +169,14 @@
} }
} }
//if forum is hidden then only teacher and admin can see it
if ($forum->visible == 0 and !isadmin() and !isteacher($course->id)) {
print_heading("Sorry, you don't have permission to see this discussion");
print_footer($course);
die;
}
/// Print the controls across the top /// Print the controls across the top