]> git.mjollnir.org Git - moodle.git/commitdiff
round up enrolment to day, truncate the rest MDL-10181
authortoyomoyo <toyomoyo>
Wed, 4 Jul 2007 02:26:36 +0000 (02:26 +0000)
committertoyomoyo <toyomoyo>
Wed, 4 Jul 2007 02:26:36 +0000 (02:26 +0000)
lib/accesslib.php

index e02c28b49ad5e099b2ae77586c5ce6470b690514..5f1c6dbc96e168d5d99f99bf626658b87eb9ab26 100755 (executable)
@@ -2295,8 +2295,10 @@ function role_unassign($roleid=0, $userid=0, $groupid=0, $contextid=0, $enrol=NU
 function enrol_into_course($course, $user, $enrol) {
 
     $timestart = time();
+    // remove time part from the timestamp and keep only the date part
+    $timestart = make_timestamp(date('Y', $timestart), date('m', $timestart), date('d', $timestart), 0, 0, 0);
     if ($course->enrolperiod) {
-        $timeend = time() + $course->enrolperiod;
+        $timeend = $timestart + $course->enrolperiod;
     } else {
         $timeend = 0;
     }