$SESSION->currentgroup[$course->id] = $SESSION->oldcurrentgroup;
unset($SESSION->oldcurrentgroup);
}
+ if (isset($SESSION->oldtimeaccess)) { // Restore previous timeaccess settings
+ $USER->timeaccess = $SESSION->oldtimeaccess;
+ unset($SESSION->oldtimeaccess);
+ }
redirect($_SERVER["HTTP_REFERER"]);
exit;
error("You can not login as this person!");
}
+ // Remember current timeaccess settings for later
+
+ if (isset($USER->timeaccess)) {
+ $SESSION->oldtimeaccess = $USER->timeaccess;
+ }
+
// Login as this student and return to course home page.
$teacher_name = fullname($USER, true);