]> git.mjollnir.org Git - moodle.git/commitdiff
The last access date is now that of the course.
authormoodler <moodler>
Mon, 27 Oct 2003 14:15:05 +0000 (14:15 +0000)
committermoodler <moodler>
Mon, 27 Oct 2003 14:15:05 +0000 (14:15 +0000)
user/view.php

index 91c9d7eceeaef22b0b9a6b6d365bf107dde59406..eda8489fbaf2264b294bce63463495aed4780a3b 100644 (file)
         require_login($course->id);
     }
 
-    $countries = get_list_of_countries();
-
     add_to_log($course->id, "user", "view", "view.php?id=$user->id&course=$course->id", "$user->id");
 
+    if ($student = get_record("user_students", "userid", $user->id, "course", $course->id)) {
+        $user->lastaccess = $student->timeaccess;
+    } else if ($teacher = get_record("user_teachers", "userid", $user->id, "course", $course->id)) {
+        $user->lastaccess = $teacher->timeaccess;
+    }
+
     $fullname = "$user->firstname $user->lastname";
     $personalprofile = get_string("personalprofile");
     $participants = get_string("participants");
@@ -92,6 +96,7 @@
     echo "<table border=\"0\" cellpadding=\"5\" cellspacing=\"2\"";
 
     if ($user->city or $user->country) {
+        $countries = get_list_of_countries();
         print_row(get_string("location").":", "$user->city, ".$countries["$user->country"]);
     }