From 14147859cee18fd26f022a9f316721a991765c5c Mon Sep 17 00:00:00 2001 From: martin Date: Thu, 1 Aug 2002 07:09:39 +0000 Subject: [PATCH] Make sure we still log the fact that the teacher logged in as someone though. Also, make the "realuser" the teacher's id, in case we want to use it later --- course/loginas.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/course/loginas.php b/course/loginas.php index 52f161e482..febaf7f866 100644 --- a/course/loginas.php +++ b/course/loginas.php @@ -23,16 +23,16 @@ // Login as this student and return to course home page. $teacher_name = "$USER->firstname $USER->lastname"; + $teacher_id = "$USER->id"; $USER = get_user_info_from_db("id", $user); $USER->loggedin = true; - $USER->realuser = $teacher_name; - set_moodle_cookie($USER->username); - $student_name = "$USER->firstname $USER->lastname"; - - add_to_log($course->id, "course", "loginas", "../user/view.php?id=$course->id&user=$user", "$teacher_name"); + + add_to_log($course->id, "course", "loginas", "../user/view.php?id=$course->id&user=$user", "$teacher_name -> $student_name"); + + $USER->realuser = $teacher_id; notice("You are now logged in as $student_name", "$CFG->wwwroot/course/view.php?id=$course->id"); -- 2.39.5