From 9ddc0efd8e2959c71226c3769a611821d5fdca26 Mon Sep 17 00:00:00 2001 From: moodler Date: Thu, 29 Jul 2004 14:52:07 +0000 Subject: [PATCH] Use enroperiod for new students if it's set --- course/student.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/course/student.php b/course/student.php index 5acea5281a..4442866ff7 100644 --- a/course/student.php +++ b/course/student.php @@ -60,7 +60,13 @@ if (!empty($add)) { check_for_restricted_user($USER->username, "$CFG->wwwroot/course/student.php?id=$course->id"); - if (! enrol_student($add, $course->id)) { + if ($course->enrolperiod) { + $timestart = time(); + $timeend = $timestart + $course->enrolperiod; + } else { + $timestart = $timeend = 0; + } + if (! enrol_student($add, $course->id, $timestart, $timeend)) { error("Could not add that student to this course!"); } } -- 2.39.5