Skip to content

Commit

Permalink
Tidy-ups for user profile page
Browse files Browse the repository at this point in the history
  • Loading branch information
moodler committed Sep 13, 2006
1 parent 761a155 commit e82dc9b
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions user/view.php
Expand Up @@ -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;
}
}

Expand Down Expand Up @@ -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))) {
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 ///////
Expand Down

0 comments on commit e82dc9b

Please sign in to comment.