allow guests to see the reply link
authortoyomoyo <toyomoyo>
Tue, 13 Mar 2007 04:49:05 +0000 (04:49 +0000)
committertoyomoyo <toyomoyo>
Tue, 13 Mar 2007 04:49:05 +0000 (04:49 +0000)
mod/forum/discuss.php

index 425e691fa18459f4744aae83b297df475d564593..171d4098e1ba8e0c6ff865326c246fc310b991e9 100644 (file)
     }
     
     $groupmode = groupmode($course, $cm);  
-    if ($canreply = has_capability($capname, $modcontext)) { 
-    
+    if ($canreply = has_capability($capname, $modcontext)) {
          
         if ($groupmode && !has_capability('moodle/site:accessallgroups', $modcontext)) {   
             // Groups must be kept separate
                     (ismember($discussion->groupid) || $mygroupid == $discussion->groupid) );
             }
         }
+    } else { // allow guests to see the link
+        $coursecontext = get_context_instance(CONTEXT_COURSE, $course->id);
+        if (has_capability('moodle/legacy:guest', $coursecontext, NULL, false)) {  // User is a guest here!
+            $canreply = true;
+        }
     }
 
 /// Print the controls across the top