Permalink
Browse files

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
  • Loading branch information...
1 parent 9132e86 commit 14147859cee18fd26f022a9f316721a991765c5c martin committed Aug 1, 2002
Showing with 5 additions and 5 deletions.
  1. +5 −5 course/loginas.php
View
@@ -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");

0 comments on commit 1414785

Please sign in to comment.