]> git.mjollnir.org Git - moodle.git/commitdiff
Tidy-ups for user profile page
authormoodler <moodler>
Wed, 13 Sep 2006 06:56:25 +0000 (06:56 +0000)
committermoodler <moodler>
Wed, 13 Sep 2006 06:56:25 +0000 (06:56 +0000)
user/view.php

index 3e9de03c35cb6c5706ae7afb42f5a7c668044592..bd7c29c40edc21d40273988cf702e7b86c04ec99 100644 (file)
     add_to_log($course->id, "user", "view", "view.php?id=$user->id&course=$course->id", "$user->id");
 
     if ($course->id != SITEID) {
-        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;
+        if ($lastaccess = get_record('user_lastaccess', 'userid', $user->id, 'course', $course->id)) {
+            $user->lastaccess = $lastaccess->timeaccess;
         }
     }
 
                      "$fullname", "", "", true, "&nbsp;", navmenu($course));
     }
 
-    if ($CFG->debug && $USER->id == $user->id) {   // TEMPORARY in DEV!
-        print_heading('DEBUG MODE:  User session variables');
-        print_object($USER);
-    }
-
 
     if ($course->category and ! isguest() ) {   // Need to have access to a course to see that info
         if (!has_capability('moodle/course:view', get_context_instance(CONTEXT_COURSE, $course->id))) {
     }
 /// printing roles
     
-    $rolestring = get_user_roles_in_context($id, $coursecontext->id);
-    print_row(get_string("roles").":", $rolestring);
+    if ($rolestring = get_user_roles_in_context($id, $coursecontext->id)) {
+        print_row(get_string('roles').':', $rolestring);
+    }
 
 /// Printing groups
     $isseparategroups = ($course->groupmode == SEPARATEGROUPS and $course->groupmodeforce and
     echo "<td></td>";
     echo "</tr></table></div>\n";
 
+
+    if ($CFG->debug && $USER->id == $user->id) {   // TEMPORARY in DEV!   XXX TODO
+        echo '<hr />';
+        print_heading('DEBUG MODE:  User session variables');
+        print_object($USER);
+    }
+
+
     print_footer($course);
 
 /// Functions ///////