]> git.mjollnir.org Git - moodle.git/commitdiff
Merged fix for letting guests see discussion post button from stable
authormoodler <moodler>
Mon, 23 Oct 2006 13:23:16 +0000 (13:23 +0000)
committermoodler <moodler>
Mon, 23 Oct 2006 13:23:16 +0000 (13:23 +0000)
mod/forum/lib.php

index cb65d62c292973f8ad177a977be2a7e8b8b0f831..802f83a9f89a2c67626a5b7fb6231306282fc20b 100644 (file)
@@ -3115,7 +3115,9 @@ function forum_print_latest_discussions($course, $forum, $maxdiscussions=5, $dis
 
 /// If the user can post discussions, then this is a good place to put the button for it
     //add group mode in there, to test for visible group
-    if (forum_user_can_post_discussion($forum, $currentgroup, $groupmode)) {
+    if (forum_user_can_post_discussion($forum, $currentgroup, $groupmode) ||
+        has_capability('moodle/legacy:guest', $context, NULL, false)) {  
+
         echo '<div class="singlebutton forumaddnew">';
         echo "<form name=\"newdiscussionform\" method=\"get\" action=\"$CFG->wwwroot/mod/forum/post.php\">";
         echo "<input type=\"hidden\" name=\"forum\" value=\"$forum->id\" />";