Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Better check of upcoming enrolment

  • Loading branch information...
commit 33cfeeb2a5092b04ca98cd1bf02b893f208e662a 1 parent 34f5efc
moodler authored
Showing with 5 additions and 3 deletions.
  1. +5 −3 course/enrol.php
View
8 course/enrol.php
@@ -52,9 +52,11 @@
/// Double check just in case they are enrolled to start in the future
if ($student = get_record('user_students', 'userid', $USER->id, 'course', $course->id)) {
- $message = get_string('enrolmentnotyet', '', userdate($student->timestart));
- print_header();
- notice($message, $CFG->wwwroot);
+ if ($course->enrolperiod and $student->timestart and ($student->timestart >= time())) {
+ $message = get_string('enrolmentnotyet', '', userdate($student->timestart));
+ print_header();
+ notice($message, $CFG->wwwroot);
+ }
}
/// Check the submitted enrollment key if there is one
Please sign in to comment.
Something went wrong with that request. Please try again.