diff --git a/lib/accesslib.php b/lib/accesslib.php index 0a918be4e92..492e24f807a 100755 --- a/lib/accesslib.php +++ b/lib/accesslib.php @@ -2764,6 +2764,8 @@ function isguestuser($user = NULL) { * @return bool */ function is_guest($context, $user = NULL) { + global $USER; + // first find the course context $coursecontext = get_course_context($context);