]> git.mjollnir.org Git - moodle.git/commitdiff
Bug #5734 - Enrolled students can't access metacourse after unhiding while logged...
authorskodak <skodak>
Tue, 6 Jun 2006 19:01:46 +0000 (19:01 +0000)
committerskodak <skodak>
Tue, 6 Jun 2006 19:01:46 +0000 (19:01 +0000)
course/enrol.php

index 5b1b5b6408153eb1a283beb40ac82eca3f3896f7..19a154f2bf818b6d9fd0ef0792071f9ef6f8e256 100644 (file)
         error("Could not find a site!");
     }
 
-/// Check if the course is a meta course
-    if ($course->metacourse) {
-        print_header_simple();
-        notice(get_string('coursenotaccessible'), $CFG->wwwroot);
-    }
-
     check_for_restricted_user($USER->username);
 
 /// Refreshing enrolment data in the USER session
@@ -48,6 +42,7 @@
 
 /// Double check just in case they are actually enrolled already 
 /// This might occur if they were enrolled during this session
+/// also happens when course is unhidden after student logs in
 
     if ( !empty($USER->student[$course->id]) or !empty($USER->teacher[$course->id]) ) {
 
 
         redirect($destination);
     }
+
+/// Check if the course is a meta course
+/// moved here to fix bug 5734
+    if ($course->metacourse) {
+        print_header_simple();
+        notice(get_string('coursenotaccessible'), $CFG->wwwroot);
+    }
     
 /// Users can't enroll to site course
     if (!$course->category) {