ÿØÿà 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Á.. /** * Form to edit a users profile * * @copyright 1999 Martin Dougiamas http://dougiamas.com * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @package core_user */ if (!defined('MOODLE_INTERNAL')) { die('Direct access to this script is forbidden.'); // It must be included from a Moodle page. } require_once($CFG->dirroot.'/lib/formslib.php'); /** * Class user_edit_form. * * @copyright 1999 Martin Dougiamas http://dougiamas.com * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class user_edit_form extends moodleform { /** * Define the form. */ public function definition () { global $CFG, $COURSE, $USER; $mform = $this->_form; $editoroptions = null; $filemanageroptions = null; $usernotfullysetup = user_not_fully_set_up($USER); if (!is_array($this->_customdata)) { throw new coding_exception('invalid custom data for user_edit_form'); } $editoroptions = $this->_customdata['editoroptions']; $filemanageroptions = $this->_customdata['filemanageroptions']; $user = $this->_customdata['user']; $userid = $user->id; if (empty($user->country)) { // We must unset the value here so $CFG->country can be used as default one. unset($user->country); } // Accessibility: "Required" is bad legend text. $strgeneral = get_string('general'); $strrequired = get_string('required'); // Add some extra hidden fields. $mform->addElement('hidden', 'id'); $mform->setType('id', PARAM_INT); $mform->addElement('hidden', 'course', $COURSE->id); $mform->setType('course', PARAM_INT); // Print the required moodle fields first. $mform->addElement('header', 'moodle', $strgeneral); // Shared fields. useredit_shared_definition($mform, $editoroptions, $filemanageroptions, $user); // Extra settigs. if (!empty($CFG->disableuserimages) || $usernotfullysetup) { $mform->removeElement('deletepicture'); $mform->removeElement('imagefile'); $mform->removeElement('imagealt'); } // If the user isn't fully set up, let them know that they will be able to change // their profile picture once their profile is complete. if ($usernotfullysetup) { $userpicturewarning = $mform->createElement('warning', 'userpicturewarning', 'notifymessage', get_string('newpictureusernotsetup')); $enabledusernamefields = useredit_get_enabled_name_fields(); if ($mform->elementExists('moodle_additional_names')) { $mform->insertElementBefore($userpicturewarning, 'moodle_additional_names'); } else if ($mform->elementExists('moodle_interests')) { $mform->insertElementBefore($userpicturewarning, 'moodle_interests'); } else { $mform->insertElementBefore($userpicturewarning, 'moodle_optional'); } // This is expected to exist when the form is submitted. $imagefile = $mform->createElement('hidden', 'imagefile'); $mform->insertElementBefore($imagefile, 'userpicturewarning'); } // Next the customisable profile fields. profile_definition($mform, $userid); $this->add_action_buttons(true, get_string('updatemyprofile')); $this->set_data($user); } /** * Extend the form definition after the data has been parsed. */ public function definition_after_data() { global $CFG, $DB, $OUTPUT; $mform = $this->_form; $userid = $mform->getElementValue('id'); // Trim required name fields. foreach (useredit_get_required_name_fields() as $field) { $mform->applyFilter($field, 'trim'); } if ($user = $DB->get_record('user', array('id' => $userid))) { // Remove description. if (empty($user->description) && !empty($CFG->profilesforenrolledusersonly) && !$DB->record_exists('role_assignments', array('userid' => $userid))) { $mform->removeElement('description_editor'); } // Print picture. $context = context_user::instance($user->id, MUST_EXIST); $fs = get_file_storage(); $hasuploadedpicture = ($fs->file_exists($context->id, 'user', 'icon', 0, '/', 'f2.png') || $fs->file_exists($context->id, 'user', 'icon', 0, '/', 'f2.jpg')); if (!empty($user->picture) && $hasuploadedpicture) { $imagevalue = $OUTPUT->user_picture($user, array('courseid' => SITEID, 'size' => 64)); } else { $imagevalue = get_string('none'); } $imageelement = $mform->getElement('currentpicture'); $imageelement->setValue($imagevalue); if ($mform->elementExists('deletepicture') && !$hasuploadedpicture) { $mform->removeElement('deletepicture'); } // Disable fields that are locked by auth plugins. $fields = get_user_fieldnames(); $authplugin = get_auth_plugin($user->auth); $customfields = $authplugin->get_custom_user_profile_fields(); $customfieldsdata = profile_user_record($userid, false); $fields = array_merge($fields, $customfields); foreach ($fields as $field) { if ($field === 'description') { // Hard coded hack for description field. See MDL-37704 for details. $formfield = 'description_editor'; } else { $formfield = $field; } if (!$mform->elementExists($formfield)) { continue; } // Get the original value for the field. if (in_array($field, $customfields)) { $key = str_replace('profile_field_', '', $field); $value = isset($customfieldsdata->{$key}) ? $customfieldsdata->{$key} : ''; } else { $value = $user->{$field}; } $configvariable = 'field_lock_' . $field; if (isset($authplugin->config->{$configvariable})) { if ($authplugin->config->{$configvariable} === 'locked') { $mform->hardFreeze($formfield); $mform->setConstant($formfield, $value); } else if ($authplugin->config->{$configvariable} === 'unlockedifempty' and $value != '') { $mform->hardFreeze($formfield); $mform->setConstant($formfield, $value); } } } // Next the customisable profile fields. profile_definition_after_data($mform, $user->id); } else { profile_definition_after_data($mform, 0); } } /** * Validate incoming form data. * @param array $usernew * @param array $files * @return array */ public function validation($usernew, $files) { global $CFG, $DB; $errors = parent::validation($usernew, $files); $usernew = (object)$usernew; $user = $DB->get_record('user', array('id' => $usernew->id)); // Validate email. if (!isset($usernew->email)) { // Mail not confirmed yet. } else if (!validate_email($usernew->email)) { $errors['email'] = get_string('invalidemail'); } else if (($usernew->email !== $user->email) && empty($CFG->allowaccountssameemail)) { // Make a case-insensitive query for the given email address. $select = $DB->sql_equal('email', ':email', false) . ' AND mnethostid = :mnethostid AND id <> :userid'; $params = array( 'email' => $usernew->email, 'mnethostid' => $CFG->mnet_localhost_id, 'userid' => $usernew->id ); // If there are other user(s) that already have the same email, show an error. if ($DB->record_exists_select('user', $select, $params)) { $errors['email'] = get_string('emailexists'); } } if (isset($usernew->email) and $usernew->email === $user->email and over_bounce_threshold($user)) { $errors['email'] = get_string('toomanybounces'); } if (isset($usernew->email) and !empty($CFG->verifychangedemail) and !isset($errors['email']) and !has_capability('moodle/user:update', context_system::instance())) { $errorstr = email_is_not_allowed($usernew->email); if ($errorstr !== false) { $errors['email'] = $errorstr; } } // Next the customisable profile fields. $errors += profile_validation($usernew, $files); return $errors; } }