From 7b08a2ea3f5bcffc2d6b6ca79841a810c600d139 Mon Sep 17 00:00:00 2001 From: moodler Date: Fri, 20 Oct 2006 06:19:22 +0000 Subject: [PATCH] Merged fixes for MDL-7116 from stable --- mod/forum/discuss.php | 5 ++--- mod/forum/post.php | 6 ++++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/mod/forum/discuss.php b/mod/forum/discuss.php index 5a66d82bc6..7e56c9c65d 100644 --- a/mod/forum/discuss.php +++ b/mod/forum/discuss.php @@ -164,7 +164,7 @@ /// 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); @@ -186,8 +186,7 @@ } 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) ); } } diff --git a/mod/forum/post.php b/mod/forum/post.php index a6dfd05563..59cf6eb1a7 100644 --- a/mod/forum/post.php +++ b/mod/forum/post.php @@ -13,14 +13,16 @@ $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'); } -- 2.39.5