Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Remember timeaccess settings even after returning from logging as

another person
  • Loading branch information...
commit a5daf57cdc1b72f9e4e9dc66224246c70eedce27 1 parent 46a6505
moodler authored
Showing with 10 additions and 0 deletions.
  1. +10 −0 course/loginas.php
View
10 course/loginas.php
@@ -25,6 +25,10 @@
$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;
@@ -44,6 +48,12 @@
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);
Please sign in to comment.
Something went wrong with that request. Please try again.