From a8adeff529ea098a997959f460f0fe9bb1768880 Mon Sep 17 00:00:00 2001 From: moodler Date: Thu, 8 Dec 2005 05:00:41 +0000 Subject: [PATCH] Adding if statement to verify whether user can see postings or not (Bug #4431) --- mod/forum/discuss.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/mod/forum/discuss.php b/mod/forum/discuss.php index d75d9e7ee09..b5a83a16563 100644 --- a/mod/forum/discuss.php +++ b/mod/forum/discuss.php @@ -138,6 +138,8 @@ $groupmode = groupmode($course, $cm); } + + if ($groupmode and !isteacheredit($course->id)) { // Groups must be kept separate $mygroupid = mygroupid($course->id); @@ -159,6 +161,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