MDL-30273 prevent the creation of discussions in simple single forums

This commit is contained in:
Charles Fulton
2011-11-18 14:11:49 +08:00
committed by [email protected]
parent fe41ba7489
commit 5a1038bb47
+4
View File
@@ -4831,6 +4831,10 @@ function forum_user_can_post_discussion($forum, $currentgroup=null, $unused=-1,
if (!has_capability($capname, $context)) {
return false;
}
if ($forum->type == 'single') {
return false;
}
if ($forum->type == 'eachuser') {
if (forum_user_has_posted_discussion($forum->id, $USER->id)) {