mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 14:27:22 +01:00
forum MDL-24638 merged changes from 19 to HEAD
This commit is contained in:
parent
954c0eac0f
commit
2e9459108c
@ -1852,6 +1852,8 @@ function forum_get_readable_forums($userid, $courseid=0) {
|
||||
}
|
||||
$context = get_context_instance(CONTEXT_MODULE, $cm->id);
|
||||
$forum = $courseforums[$forumid];
|
||||
$forum->context = $context;
|
||||
$forum->cm = $cm;
|
||||
|
||||
if (!has_capability('mod/forum:viewdiscussion', $context)) {
|
||||
continue;
|
||||
@ -1942,8 +1944,8 @@ function forum_search_posts($searchterms, $courseid=0, $limitfrom=0, $limitnum=5
|
||||
$params = array('userid'=>$USER->id, 'timestart'=>$now, 'timeend'=>$now);
|
||||
}
|
||||
|
||||
$cm = get_coursemodule_from_instance('forum', $forumid);
|
||||
$context = get_context_instance(CONTEXT_MODULE, $cm->id);
|
||||
$cm = $forum->cm;
|
||||
$context = $forum->context;
|
||||
|
||||
if ($forum->type == 'qanda'
|
||||
&& !has_capability('mod/forum:viewqandawithoutposting', $context)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user