category) { require_login($course->id); } else if ($CFG->forcelogin or !empty($CFG->forceloginforprofiles)) { if (isguest()) { redirect("$CFG->wwwroot/login/index.php"); } require_login(); } 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 = fullname($user, isteacher($course->id)); $personalprofile = get_string("personalprofile"); $participants = get_string("participants"); if (empty($USER->id)) { $currentuser = false; } else { $currentuser = ($user->id == $USER->id); } if (groupmode($course) == SEPARATEGROUPS and !isteacheredit($course->id)) { // Groups must be kept separate require_login(); if (!isteacheredit($course->id, $user->id) and !ismember(mygroupid($course->id), $user->id)) { print_header("$personalprofile: ", "$personalprofile: ", "id\">$course->shortname -> id\">$participants", "", "", true, " ", navmenu($course)); error(get_string("groupnotamember"), "../course/view.php?id=$course->id"); } } if (!$course->category and !$currentuser) { // To reduce possibility of "browsing" userbase at site level if (!isteacher() and !isteacher(0, $user->id) ) { // Teachers can browse and be browsed at site level print_header("$personalprofile: ", "$personalprofile: ", "id\">$participants", "", "", true, " ", navmenu($course)); print_heading(get_string('usernotavailable', 'error')); print_footer($course); die; } } if ($course->category) { print_header("$personalprofile: $fullname", "$personalprofile: $fullname", "id\">$course->shortname -> id\">$participants -> $fullname", "", "", true, " ", navmenu($course)); } else { print_header("$course->fullname: $personalprofile: $fullname", "$course->fullname", "$fullname", "", "", true, " ", navmenu($course)); } if ($course->category and ! isguest() ) { // Need to have access to a course to see that info if (!isstudent($course->id, $user->id) && !isteacher($course->id, $user->id)) { print_heading(get_string("notenrolled", "", $fullname)); print_footer($course); die; } } if ($user->deleted) { print_heading(get_string("userdeleted")); } echo "
"; print_user_picture($user->id, $course->id, $user->picture, true, false, false); echo " | cellcontent\" class=\"userinfoboxcontent\">";
// Print name and edit button across top
echo "
".format_text($user->description, FORMAT_MOODLE)." "; } // Print all the little details in a list echo " |
"; } else if (strlen($CFG->changepassword) > 1) { echo " | "; } } if ($course->category and ((isstudent($course->id) and ($user->id == $USER->id) and !isguest() and $CFG->allowunenroll) or (isteacheredit($course->id) and isstudent($course->id, $user->id))) ) { echo " | "; echo "id\" />"; echo "id\" />"; echo "shortname)."\">"; echo " | "; } if (isteacher($course->id) or ($course->showreports and $USER->id == $user->id)) { echo ""; } if ((isadmin() and !isadmin($user->id)) or (isteacher($course->id) and ($USER->id != $user->id) and !iscreator($user->id))) { echo " | "; } echo " |
$left
$right