From 332fbc302793d959c177d59fc2e067c76d1b2e97 Mon Sep 17 00:00:00 2001 From: skodak Date: Tue, 6 Jun 2006 19:01:46 +0000 Subject: [PATCH] Bug #5734 - Enrolled students can't access metacourse after unhiding while logged in; merged from MODOLE_16_STABLE --- course/enrol.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/course/enrol.php b/course/enrol.php index 5b1b5b6408..19a154f2bf 100644 --- a/course/enrol.php +++ b/course/enrol.php @@ -20,12 +20,6 @@ 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]) ) { @@ -60,6 +55,13 @@ 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) { -- 2.39.5