Skip to content

Commit

Permalink
MDL-30157 enrol_manual: timestart a few seconds before
Browse files Browse the repository at this point in the history
We want to prevent conflicts with get_enrolled_sql trick for db caching
plus users should be able to access the course once enrolled.
  • Loading branch information
David Monllao committed Sep 17, 2015
1 parent 8c55a50 commit ba523bf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion enrol/manual/ajax.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,9 @@
$timestart = $course->startdate;
break;
case 4:
$timestart = time();
// We mimic get_enrolled_sql round(time(), -2) but always floor as we want users to always access their
// courses once they are enrolled.
$timestart = intval(substr(time(), 0, 8) . '00') - 1;
break;
case 3:
default:
Expand Down
4 changes: 3 additions & 1 deletion enrol/manual/manage.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,9 @@
$timestart = $course->startdate;
break;
case 4:
$timestart = $now;
// We mimic get_enrolled_sql round(time(), -2) but always floor as we want users to always access their
// courses once they are enrolled.
$timestart = intval(substr($now, 0, 8) . '00') - 1;
break;
case 3:
default:
Expand Down

0 comments on commit ba523bf

Please sign in to comment.