MDL-14724 Students cannot see discussions in forums made by teachers if timedposts enabled

This commit is contained in:
skodak
2008-05-07 11:30:59 +00:00
parent 57d6548065
commit c8b8b71645
+2 -2
View File
@@ -2174,7 +2174,7 @@ function forum_get_discussions($cm, $forumsort="d.timemodified DESC", $fullpost=
$modcontext = get_context_instance(CONTEXT_MODULE, $cm->id);
if (!has_capability('mod/forum:viewhiddentimedposts', $modcontext)) {
$timelimit = " AND ((d.timestart = < $now) AND (d.timeend = 0 OR d.timeend > $now)";
$timelimit = " AND ((d.timestart <= $now AND (d.timeend = 0 OR d.timeend > $now))";
if (isloggedin()) {
$timelimit .= " OR d.userid = $USER->id";
}
@@ -2346,7 +2346,7 @@ function forum_get_discussions_count($cm) {
$modcontext = get_context_instance(CONTEXT_MODULE, $cm->id);
if (!has_capability('mod/forum:viewhiddentimedposts', $modcontext)) {
$timelimit = " AND ((d.timestart = < $now) AND (d.timeend = 0 OR d.timeend > $now)";
$timelimit = " AND ((d.timestart <= $now AND (d.timeend = 0 OR d.timeend > $now))";
if (isloggedin()) {
$timelimit .= " OR d.userid = $USER->id";
}