]> git.mjollnir.org Git - moodle.git/commitdiff
Some fixes to ensure students can't post to hidden forums
authormoodler <moodler>
Fri, 30 Apr 2004 01:54:56 +0000 (01:54 +0000)
committermoodler <moodler>
Fri, 30 Apr 2004 01:54:56 +0000 (01:54 +0000)
mod/forum/post.php

index 82fd8e3dee7a9cfe8a44862e44867d62250732fc..c7dbe240468f94020faabf623830c14944fbab1c 100644 (file)
             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;
                     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.