Some fixes to ensure students can't post to hidden forums
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user