Permalink
Browse files

Set student enrolment end date to course enrolment period for external

database enrolments.  (fix MDL-6272)
  • Loading branch information...
martinlanghoff
martinlanghoff committed Sep 28, 2006
1 parent 8aa18dd commit c83afe4ec24710f7383f7a74216f0a4f5f6008fd
Showing with 7 additions and 1 deletion.
  1. +7 −1 enrol/database/enrol.php
View
@@ -41,7 +41,13 @@ function get_student_courses(&$user) {
if (isset($user->student[$course->id])) { /// We have it already
unset($user->student[$course->id]); /// Remove from old list
} else {
- enrol_student($user->id, $course->id, 0, 0, 'database'); /// Enrol the student
+ if ($course->enrolperiod) {
+ $timestart = time();
+ $timeend = time() + $course->enrolperiod;
+ } else {
+ $timestart = $timeend = 0;
+ }
+ enrol_student($user->id, $course->id, $timestart, $timeend, 'database');
}
}
}

0 comments on commit c83afe4

Please sign in to comment.