From: martin Date: Thu, 1 Aug 2002 07:09:39 +0000 (+0000) Subject: Make sure we still log the fact that the teacher logged in as someone though. X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=14147859cee18fd26f022a9f316721a991765c5c;p=moodle.git 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 --- 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");