Skip to content

Commit

Permalink
Some fixes to ensure students can't post to hidden forums
Browse files Browse the repository at this point in the history
  • Loading branch information
moodler committed Apr 30, 2004
1 parent 47a2aa4 commit 8060210
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions mod/forum/post.php
Expand Up @@ -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;
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 8060210

Please sign in to comment.