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

This commit is contained in:
Charles Fulton
2011-11-18 15:40:34 +08:00
committed by [email protected]
parent f28832d5c0
commit 23e7302a9e
+4
View File
@@ -4827,6 +4827,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)) {