From a5b9e4d94e601ccb0cf3606e2eca6dc8c24ae985 Mon Sep 17 00:00:00 2001 From: moodler Date: Tue, 31 Aug 2004 09:59:59 +0000 Subject: [PATCH] Prevent restricted users from using "login as" --- course/loginas.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/course/loginas.php b/course/loginas.php index 246003aa162..289b0879102 100644 --- a/course/loginas.php +++ b/course/loginas.php @@ -40,6 +40,8 @@ error("Only teachers can use this page!"); } + check_for_restricted_user($USER->username, "$CFG->wwwroot/user/view.php?id=$user"); + if ($course->category and !isstudent($course->id, $user) and !isadmin()) { error("This student is not in this course!"); }