mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
Bug #5734 - Enrolled students can't access metacourse after unhiding while logged in; merged from MODOLE_16_STABLE
This commit is contained in:
parent
f801c7e028
commit
332fbc3027
1 changed files with 8 additions and 6 deletions
|
@ -20,12 +20,6 @@
|
||||||
error("Could not find a site!");
|
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);
|
check_for_restricted_user($USER->username);
|
||||||
|
|
||||||
/// Refreshing enrolment data in the USER session
|
/// Refreshing enrolment data in the USER session
|
||||||
|
@ -48,6 +42,7 @@
|
||||||
|
|
||||||
/// Double check just in case they are actually enrolled already
|
/// Double check just in case they are actually enrolled already
|
||||||
/// This might occur if they were enrolled during this session
|
/// 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]) ) {
|
if ( !empty($USER->student[$course->id]) or !empty($USER->teacher[$course->id]) ) {
|
||||||
|
|
||||||
|
@ -61,6 +56,13 @@
|
||||||
redirect($destination);
|
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
|
/// Users can't enroll to site course
|
||||||
if (!$course->category) {
|
if (!$course->category) {
|
||||||
print_header_simple();
|
print_header_simple();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue