mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 08:56:36 +02:00
Remember timeaccess settings even after returning from logging as
another person
This commit is contained in:
parent
46a6505fd5
commit
a5daf57cdc
1 changed files with 10 additions and 0 deletions
|
@ -25,6 +25,10 @@
|
||||||
$SESSION->currentgroup[$course->id] = $SESSION->oldcurrentgroup;
|
$SESSION->currentgroup[$course->id] = $SESSION->oldcurrentgroup;
|
||||||
unset($SESSION->oldcurrentgroup);
|
unset($SESSION->oldcurrentgroup);
|
||||||
}
|
}
|
||||||
|
if (isset($SESSION->oldtimeaccess)) { // Restore previous timeaccess settings
|
||||||
|
$USER->timeaccess = $SESSION->oldtimeaccess;
|
||||||
|
unset($SESSION->oldtimeaccess);
|
||||||
|
}
|
||||||
|
|
||||||
redirect($_SERVER["HTTP_REFERER"]);
|
redirect($_SERVER["HTTP_REFERER"]);
|
||||||
exit;
|
exit;
|
||||||
|
@ -44,6 +48,12 @@
|
||||||
error("You can not login as this person!");
|
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.
|
// Login as this student and return to course home page.
|
||||||
|
|
||||||
$teacher_name = fullname($USER, true);
|
$teacher_name = fullname($USER, true);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue