]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-13149 - use correct capability checks to decide which forum subscribe
authorpoltawski <poltawski>
Sun, 27 Jan 2008 17:01:12 +0000 (17:01 +0000)
committerpoltawski <poltawski>
Sun, 27 Jan 2008 17:01:12 +0000 (17:01 +0000)
links to display
merged from MOODLE_19_STABLE

mod/forum/view.php

index 8a96fc7aa2b4c6ea7bd25589f52b8549f3d3f192..4546cf2d317510053e16f50a6b051af813cd9875 100644 (file)
             echo '<span class="helplink">' . get_string("forcessubscribe", 'forum') . '</span><br />';
             helpbutton("subscription", $strallowchoice, "forum");
             echo '&nbsp;<span class="helplink">';
-            if (has_capability('moodle/course:manageactivities', $context)) {
+            if (has_capability('mod/forum:managesubscriptions', $context)) {
                 echo "<a title=\"$strallowchoice\" href=\"subscribe.php?id=$forum->id&amp;force=no\">$strallowchoice</a>";
             } else {
                 echo $streveryoneisnowsubscribed;
             echo '<span class="helplink">' . get_string("allowsallsubscribe", 'forum') . '</span><br />';
             helpbutton("subscription", $strforcesubscribe, "forum");
             echo '&nbsp;';
-            if (has_capability('moodle/course:manageactivities', $context)) {
+
+            if (has_capability('mod/forum:managesubscriptions', $context)) {
                 echo "<span class=\"helplink\"><a title=\"$strforcesubscribe\" href=\"subscribe.php?id=$forum->id&amp;force=yes\">$strforcesubscribe</a></span>";
-                echo "<br />";
-                echo "<span class=\"helplink\"><a href=\"subscribers.php?id=$forum->id\">$strshowsubscribers</a></span>";
             } else {
                 echo '<span class="helplink">'.$streveryonecannowchoose.'</span>';
             }
 
+            if(has_capability('mod/forum:viewsubscribers', $context)){
+                echo "<br />";
+                echo "<span class=\"helplink\"><a href=\"subscribers.php?id=$forum->id\">$strshowsubscribers</a></span>";
+            }
+
             echo '<div class="helplink" id="subscriptionlink">', forum_get_subscribe_link($forum, $context, 
                     array('forcesubscribed' => '', 'cantsubscribe' => '')), '</div>';
         }