Merged fixes for MDL-7116 from stable
This commit is contained in:
@@ -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) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+4
-2
@@ -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');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user