Made the page a lot friendlier when you access a course in a switched Guest role.

MDL-6885 has details
This commit is contained in:
moodler
2006-10-12 07:27:18 +00:00
parent be653a00cc
commit d5ebb85dce
+9 -2
View File
@@ -1630,8 +1630,15 @@ function require_login($courseid=0, $autologinguest=true, $cm=null) {
break;
default: /// Guests not allowed
print_header_simple();
notice(get_string('guestsnotallowed', '', $course->fullname), "$CFG->wwwroot/login/index.php");
print_header_simple('', '', get_string('loggedinasguest'));
if (empty($USER->switchrole[$context->id])) { // Normal guest
notice(get_string('guestsnotallowed', '', $course->fullname), "$CFG->wwwroot/login/index.php");
} else {
notify(get_string('guestsnotallowed', '', $course->fullname));
echo '<div class="notifyproblem">'.switchroles_form($course->id).'</div>';
print_footer($course);
exit;
}
break;
}