]> git.mjollnir.org Git - moodle.git/commitdiff
Use enroperiod for new students if it's set
authormoodler <moodler>
Thu, 29 Jul 2004 14:52:07 +0000 (14:52 +0000)
committermoodler <moodler>
Thu, 29 Jul 2004 14:52:07 +0000 (14:52 +0000)
course/student.php

index 5acea5281a66bc6d2cad63186c97169cfd618610..4442866ff720a601771e52b1701ce3c4591e7ae6 100644 (file)
 
     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!");
         }
     }