From 82b37f12e2e066c7b9787a35161e6a09fdde5477 Mon Sep 17 00:00:00 2001 From: moodler Date: Sun, 5 Nov 2006 06:46:20 +0000 Subject: [PATCH] Merge loginas fix for site level --- course/loginas.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/course/loginas.php b/course/loginas.php index 8be8fff0a6..11f99b0b30 100644 --- a/course/loginas.php +++ b/course/loginas.php @@ -50,15 +50,15 @@ } else { require_login($course->id); $context = get_context_instance(CONTEXT_COURSE, $course->id); + if (!has_capability('moodle/course:view', $context, $userid, false)) { + error('This user is not in this course!'); + } } /// User must have permissions require_capability('moodle/user:loginas', $context); - if (!has_capability('moodle/course:view', $context, $userid, false)) { - error('This user is not in this course!'); - } /// Remember current timeaccess settings for later -- 2.39.5