forum MDL-24638 merged changes from 19 to HEAD

This commit is contained in:
Aparup Banerjee 2010-10-22 02:04:42 +00:00
parent 954c0eac0f
commit 2e9459108c

View File

@ -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)) {