From 806021014b9253bb225f38da04dfe80574185398 Mon Sep 17 00:00:00 2001 From: moodler Date: Fri, 30 Apr 2004 01:54:56 +0000 Subject: [PATCH] Some fixes to ensure students can't post to hidden forums --- mod/forum/post.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/mod/forum/post.php b/mod/forum/post.php index 82fd8e3dee..c7dbe24046 100644 --- a/mod/forum/post.php +++ b/mod/forum/post.php @@ -145,6 +145,12 @@ error("Sorry, but you can not post a new discussion in this forum."); } + if ($cm = get_coursemodule_from_instance("forum", $forum->id, $course->id)) { + if (!$cm->visible and !isteacher($course->id)) { + error(get_string("activityiscurrentlyhidden")); + } + } + // Load up the $post variable. $post->course = $course->id; @@ -184,6 +190,9 @@ error("Sorry, but you can not post in this discussion."); } } + if (!$cm->visible and !isteacher($course->id)) { + error(get_string("activityiscurrentlyhidden")); + } } // Load up the $post variable. -- 2.39.5