]> git.mjollnir.org Git - moodle.git/commitdiff
Remember timeaccess settings even after returning from logging as
authormoodler <moodler>
Fri, 21 May 2004 15:10:47 +0000 (15:10 +0000)
committermoodler <moodler>
Fri, 21 May 2004 15:10:47 +0000 (15:10 +0000)
another person

course/loginas.php

index 58e51d6a5bf0650c9fc16f85d4d260c1d9ab0ef9..246003aa162d096d9712444121466231e60415a2 100644 (file)
             $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);