ÿØÿà JFIF    ÿÛ „  ( %"1!%)+...383,7(-.+  -+++--++++---+-+-----+---------------+---+-++7-----ÿÀ  ß â" ÿÄ     ÿÄ H    !1AQaq"‘¡2B±ÁÑð#R“Ò Tbr‚²á3csƒ’ÂñDS¢³$CÿÄ   ÿÄ %  !1AQa"23‘ÿÚ   ? ôÿ ¨pŸªáÿ —åYõõ\?àÒü©ŠÄï¨pŸªáÿ —åYõõ\?àÓü©ŠÄá 0Ÿªáÿ Ÿå[úƒ ú®ði~TÁbqÐ8OÕpÿ ƒOò¤Oè`–RÂáœá™êi€ßÉ< FtŸI“öÌ8úDf´°å}“¾œ6  öFá°y¥jñÇh†ˆ¢ã/ÃÐ:ªcÈ "Y¡ðÑl>ÿ ”ÏËte:qž\oäŠe÷󲍷˜HT4&ÿ ÓÐü6ö®¿øþßèô Ÿ•7Ñi’•j|“ñì>b…þS?*Óôÿ ÓÐü*h¥£ír¶ü UãS炟[AÐaè[ûª•õ&õj?†Éö+EzP—WeÒírJFt ‘BŒ†Ï‡%#tE Øz ¥OÛ«!1›üä±Í™%ºÍãö]°î(–:@<‹ŒÊö×òÆt¦ãº+‡¦%ÌÁ²h´OƒJŒtMÜ>ÀÜÊw3Y´•牋4ǍýʏTì>œú=Íwhyë,¾Ôò×õ¿ßÊa»«þˆѪQ|%6ž™A õ%:øj<>É—ÿ Å_ˆCbõ¥š±ý¯Ýƒï…¶|RëócÍf溪“t.СøTÿ *Ä¿-{†çàczůŽ_–^XþŒ±miB[X±d 1,é”zEù»& î9gœf™9Ð'.;—™i}!ôšåîqêÛ٤ёý£½ÆA–àôe"A$˝Úsäÿ ÷Û #°xŸëí(l »ý3—¥5m! rt`†0~'j2(]S¦¦kv,ÚÇ l¦øJA£Šƒ J3E8ÙiŽ:cÉžúeZ°€¯\®kÖ(79«Ž:¯X”¾³Š&¡* ….‰Ž(ÜíŸ2¥ª‡×Hi²TF¤ò[¨íÈRëÉ䢍mgÑ.Ÿ<öäS0í„ǹÁU´f#Vß;Õ–…P@3ío<ä-±»Ž.L|kªÀê›fÂ6@»eu‚|ÓaÞÆŸ…¨ááå>åŠ?cKü6ùTÍÆ”†sĤÚ;H2RÚ†õ\Ö·Ÿn'¾ ñ#ºI¤Å´%çÁ­‚â7›‹qT3Iï¨ÖÚ5I7Ë!ÅOóŸ¶øÝñØôת¦$Tcö‘[«Ö³šÒ';Aþ ¸èíg A2Z"i¸vdÄ÷.iõ®§)¿]¤À†–‡É&ä{V¶iŽ”.Ó×Õÿ û?h¬Mt–íª[ÿ Ñÿ ÌV(í}=ibÔ¡›¥¢±b Lô¥‡piη_Z<‡z§èŒ)iÖwiÇ 2hÙ3·=’d÷8éŽ1¦¸c¤µ€7›7Ø ð\á)} ¹fËí›pAÃL%âc2 í§æQz¿;T8sæ°qø)QFMð‰XŒÂ±N¢aF¨…8¯!U  Z©RÊ ÖPVÄÀÍin™Ì-GˆªÅËŠ›•zË}º±ŽÍFò¹}Uw×#ä5B¤{î}Ð<ÙD é©¤&‡ïDbàÁôMÁ.. /** * Public Profile -- a user's public profile page * * - each user can currently have their own page (cloned from system and then customised) * - users can add any blocks they want * - the administrators can define a default site public profile for users who have * not created their own public profile * * This script implements the user's view of the public profile, and allows editing * of the public profile. * * @package core_user * @copyright 2010 Remote-Learner.net * @author Hubert Chathi * @author Olav Jordan * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ require_once(__DIR__ . '/../config.php'); require_once($CFG->dirroot . '/my/lib.php'); require_once($CFG->dirroot . '/user/profile/lib.php'); require_once($CFG->dirroot . '/user/lib.php'); require_once($CFG->libdir.'/filelib.php'); $userid = optional_param('id', 0, PARAM_INT); $edit = optional_param('edit', null, PARAM_BOOL); // Turn editing on and off. $reset = optional_param('reset', null, PARAM_BOOL); // Even if the user didn't supply a userid, we treat page URL as if they did; this is needed so navigation works correctly. $userid = $userid ?: $USER->id; $PAGE->set_url('/user/profile.php', ['id' => $userid]); if (!empty($CFG->forceloginforprofiles)) { require_login(); if (isguestuser()) { $PAGE->set_context(context_system::instance()); echo $OUTPUT->header(); echo $OUTPUT->confirm(get_string('guestcantaccessprofiles', 'error'), get_login_url(), $CFG->wwwroot); echo $OUTPUT->footer(); die; } } else if (!empty($CFG->forcelogin)) { require_login(); } if ((!$user = $DB->get_record('user', array('id' => $userid))) || ($user->deleted)) { $PAGE->set_context(context_system::instance()); echo $OUTPUT->header(); if (!$user) { echo $OUTPUT->notification(get_string('invaliduser', 'error')); } else { echo $OUTPUT->notification(get_string('userdeleted')); } echo $OUTPUT->footer(); die; } $currentuser = ($user->id == $USER->id); $context = $usercontext = context_user::instance($userid, MUST_EXIST); if (!user_can_view_profile($user, null, $context)) { // Course managers can be browsed at site level. If not forceloginforprofiles, allow access (bug #4366). $struser = get_string('user'); $PAGE->set_context(context_system::instance()); $PAGE->set_title($struser); // Do not leak the name. $PAGE->set_heading($struser); $PAGE->set_pagelayout('mypublic'); $PAGE->add_body_class('limitedwidth'); $PAGE->set_url('/user/profile.php', array('id' => $userid)); $PAGE->navbar->add($struser); echo $OUTPUT->header(); echo $OUTPUT->notification(get_string('usernotavailable', 'error')); echo $OUTPUT->footer(); exit; } // Get the profile page. Should always return something unless the database is broken. if (!$currentpage = my_get_page($userid, MY_PAGE_PUBLIC)) { throw new \moodle_exception('mymoodlesetup'); } $PAGE->set_context($context); $PAGE->set_pagelayout('mypublic'); $PAGE->add_body_class('limitedwidth'); $PAGE->set_pagetype('user-profile'); // Set up block editing capabilities. if (isguestuser()) { // Guests can never edit their profile. $USER->editing = $edit = 0; // Just in case. $PAGE->set_blocks_editing_capability('moodle/my:configsyspages'); // unlikely :). } else { if ($currentuser) { $PAGE->set_blocks_editing_capability('moodle/user:manageownblocks'); } else { $PAGE->set_blocks_editing_capability('moodle/user:manageblocks'); } } // Start setting up the page. $strpublicprofile = get_string('publicprofile'); $PAGE->blocks->add_region('content'); $PAGE->set_subpage($currentpage->id); $PAGE->set_title(fullname($user).": $strpublicprofile"); $PAGE->set_heading(fullname($user)); if (!$currentuser) { $PAGE->navigation->extend_for_user($user); if ($node = $PAGE->settingsnav->get('userviewingsettings'.$user->id)) { $node->forceopen = true; } } else if ($node = $PAGE->settingsnav->get('dashboard', navigation_node::TYPE_CONTAINER)) { $node->forceopen = true; } if ($node = $PAGE->settingsnav->get('root')) { $node->forceopen = false; } // Toggle the editing state and switches. if ($PAGE->user_allowed_editing()) { if ($reset !== null) { if (!is_null($userid)) { if (!$currentpage = my_reset_page($userid, MY_PAGE_PUBLIC, 'user-profile')) { throw new \moodle_exception('reseterror', 'my'); } redirect(new moodle_url('/user/profile.php', array('id' => $userid))); } } else if ($edit !== null) { // Editing state was specified. $USER->editing = $edit; // Change editing state. } else { // Editing state is in session. if ($currentpage->userid) { // It's a page we can edit, so load from session. if (!empty($USER->editing)) { $edit = 1; } else { $edit = 0; } } else { // For the page to display properly with the user context header the page blocks need to // be copied over to the user context. if (!$currentpage = my_copy_page($userid, MY_PAGE_PUBLIC, 'user-profile')) { throw new \moodle_exception('mymoodlesetup'); } $PAGE->set_context($usercontext); $PAGE->set_subpage($currentpage->id); // It's a system page and they are not allowed to edit system pages. $USER->editing = $edit = 0; // Disable editing completely, just to be safe. } } // Add button for editing page. $params = array('edit' => !$edit, 'id' => $userid); $resetbutton = ''; $resetstring = get_string('resetpage', 'my'); $reseturl = new moodle_url("$CFG->wwwroot/user/profile.php", array('edit' => 1, 'reset' => 1, 'id' => $userid)); if (!$currentpage->userid) { // Viewing a system page -- let the user customise it. $editstring = get_string('updatemymoodleon'); $params['edit'] = 1; } else if (empty($edit)) { $editstring = get_string('updatemymoodleon'); $resetbutton = $OUTPUT->single_button($reseturl, $resetstring); } else { $editstring = get_string('updatemymoodleoff'); $resetbutton = $OUTPUT->single_button($reseturl, $resetstring); } $url = new moodle_url("$CFG->wwwroot/user/profile.php", $params); $button = ''; if (!$PAGE->theme->haseditswitch) { $button = $OUTPUT->single_button($url, $editstring); } $PAGE->set_button($resetbutton . $button); } else { $USER->editing = $edit = 0; } // Trigger a user profile viewed event. profile_view($user, $usercontext); // TODO WORK OUT WHERE THE NAV BAR IS! echo $OUTPUT->header(); echo '
'; $hiddenfields = []; if (!has_capability('moodle/user:viewhiddendetails', $usercontext)) { $hiddenfields = array_flip(explode(',', $CFG->hiddenuserfields)); } if ($user->description && !isset($hiddenfields['description'])) { echo '
'; if (!empty($CFG->profilesforenrolledusersonly) && !$currentuser && !$DB->record_exists('role_assignments', array('userid' => $user->id))) { echo get_string('profilenotshown', 'moodle'); } else { $user->description = file_rewrite_pluginfile_urls($user->description, 'pluginfile.php', $usercontext->id, 'user', 'profile', null); echo format_text($user->description, $user->descriptionformat); } echo '
'; } echo $OUTPUT->heading(get_string('userprofile', 'core_user'), 2, 'sr-only'); echo $OUTPUT->custom_block_region('content'); // Render custom blocks. $renderer = $PAGE->get_renderer('core_user', 'myprofile'); $tree = core_user\output\myprofile\manager::build_tree($user, $currentuser); echo $renderer->render($tree); echo '
'; // Userprofile class. echo $OUTPUT->footer();