]> git.mjollnir.org Git - moodle.git/commitdiff
*** empty log message ***
authormoodler <moodler>
Thu, 29 Jul 2004 13:12:35 +0000 (13:12 +0000)
committermoodler <moodler>
Thu, 29 Jul 2004 13:12:35 +0000 (13:12 +0000)
course/enrol.php

index da7d2d4d3146b2ac9b18616ede6a5f535bc2b3b4..9f0c57588ef4b62f6bbf855b2cb35e0498d32776 100644 (file)
@@ -31,7 +31,7 @@
 /// Double check just in case they are actually enrolled already 
 /// This might occur if they were enrolled during this session
 
-    if ( $USER->student[$course->id] or $USER->teacher[$course->id] ) {
+    if ( !empty($USER->student[$course->id]) or !empty($USER->teacher[$course->id]) ) {
 
         if ($SESSION->wantsurl) {
             $destination = $SESSION->wantsurl;
         redirect($destination);
     }
 
+/// 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);
+    }
 
 /// Check the submitted enrollment key if there is one