MDL-40358 Enrolments: Fixed sql when user is suspended

This commit is contained in:
Rajesh Taneja 2013-07-10 15:30:47 +08:00 committed by Marina Glancy
parent cb88ffb698
commit 117e94a050

View File

@ -302,8 +302,8 @@ class course_enrolment_manager {
'now1' => $now,
'now2' => $now);
} else if ($this->statusfilter === ENROL_USER_SUSPENDED) {
$sql .= " AND ue.status = :inactive OR e.status = :disabled OR ue.timestart > :now1
OR (ue.timeend <> 0 AND ue.timeend < :now2)";
$sql .= " AND (ue.status = :inactive OR e.status = :disabled OR ue.timestart > :now1
OR (ue.timeend <> 0 AND ue.timeend < :now2))";
$now = round(time(), -2); // rounding helps caching in DB
$params += array('disabled' => ENROL_INSTANCE_DISABLED,
'inactive' => ENROL_USER_SUSPENDED,