Tidy-ups for user profile page
This commit is contained in:
+13
-11
@@ -38,10 +38,8 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -99,11 +97,6 @@
|
||||
"$fullname", "", "", true, " ", 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))) {
|
||||
@@ -274,8 +267,9 @@
|
||||
}
|
||||
/// 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
|
||||
@@ -377,6 +371,14 @@
|
||||
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 ///////
|
||||
|
||||
Reference in New Issue
Block a user