]> git.mjollnir.org Git - moodle.git/commitdiff
Merged fixes for MDL-7116 from stable
authormoodler <moodler>
Fri, 20 Oct 2006 06:19:22 +0000 (06:19 +0000)
committermoodler <moodler>
Fri, 20 Oct 2006 06:19:22 +0000 (06:19 +0000)
mod/forum/discuss.php
mod/forum/post.php

index 5a66d82bc6b3129ecd8444df8fb14ded430c4f04..7e56c9c65d92e4fa44e4bdbacf81060cca3e59a7 100644 (file)
 /// If so, make sure the current person is allowed to see this discussion
 /// Also, if we know they should be able to reply, then explicitly set $canreply
 
-    $canreply = NULL;   /// No override one way or the other
+    $canreply = true;   /// By default, because guests etc will be asked to log in
     $groupmode = groupmode($course, $cm);
     
     
 
         } else if ($groupmode == VISIBLEGROUPS) {
             $canreply = ( (empty($mygroupid) && $discussion->groupid == -1) ||
-                    (ismember($discussion->groupid) || $mygroupid == $discussion->groupid) &&
-                    has_capability('mod/forum:replypost', $modcontext) );
+                    (ismember($discussion->groupid) || $mygroupid == $discussion->groupid) );
         }
     }
 
index a6dfd055639a29be0464d2c32485a32f1bac7d83..59cf6eb1a7a9d3d0b63dff18218a5bb2cf672406 100644 (file)
     $name = optional_param('name','',PARAM_CLEAN);
     $confirm = optional_param('confirm',0,PARAM_INT);
     
+    $sitecontext = get_context_instance(CONTEXT_SYSTEM);  
+
+    if (has_capability('moodle/legacy:guest', $sitecontext, NULL, false)) {
 
-    if (isguest()) {
         $wwwroot = $CFG->wwwroot.'/login/index.php';
         if (!empty($CFG->loginhttps)) {
             $wwwroot = str_replace('http','https', $wwwroot);
         }
 
-        if (isset($forum)) {      // User is starting a new discussion in a forum
+        if (!empty($forum)) {      // User is starting a new discussion in a forum
             if (! $forum = get_record('forum', 'id', $forum)) {
                 error('The forum number was incorrect');
             }