From 215965673b7b0c986fb9b321007f7515360694d8 Mon Sep 17 00:00:00 2001 From: moodler Date: Thu, 12 Oct 2006 07:28:22 +0000 Subject: [PATCH] Merged MDL-6885 from stable --- lib/moodlelib.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/moodlelib.php b/lib/moodlelib.php index 8519da19ea..00072d7a8e 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -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 '
'.switchroles_form($course->id).'
'; + print_footer($course); + exit; + } break; } -- 2.39.5