$USER->{$variable} = $value; } // Preload custom fields. profile_load_custom_fields($USER); } if (is_siteadmin() and empty($SITE->shortname)) { // Fresh cli install - we need to finish site settings. redirect(new moodle_url('/admin/index.php')); } if (!$emailchanged || !$CFG->emailchangeconfirmation) { redirect($returnurl); } } // Make sure we really are on the https page when https login required. $PAGE->verify_https_required(); // Display page header. $streditmyprofile = get_string('editmyprofile'); $strparticipants = get_string('participants'); $userfullname = fullname($user, true); $PAGE->set_title("{$course->shortname}: {$streditmyprofile}"); $PAGE->set_heading($userfullname); echo $OUTPUT->header(); echo $OUTPUT->heading($userfullname); if ($emailchanged) { echo $emailchangedhtml; } else { // Finally display THE form. $userform->display(); } // And proper footer. echo $OUTPUT->footer();
} // Copy file to temporary location and the send it for processing icon if ($iconfile = $file->copy_content_to_temp()) { // There is a new image that has been uploaded // Process the new image and set the user to make use of it. // NOTE: Uploaded images always take over Gravatar $newpicture = (int) process_new_icon($usercontext, 'user', 'icon', 0, $iconfile); // Delete temporary file @unlink($iconfile); // Remove uploaded file. $fs->delete_area_files($usercontext->id, 'user', 'newicon'); } } $DB->set_field('user', 'picture', $newpicture, array('id' => $USER->id)); $USER->picture = $newpicture; } if (get_user_preferences('bcp_data')) { $DB->delete_records('user_preferences', array('userid' => $USER->id, 'name' => 'bcp_data')); } if (get_user_preferences('auth_forcepasswordchange')) { $DB->delete_records('user_preferences', array('userid' => $USER->id, 'name' => 'auth_forcepasswordchange')); } echo html_writer::tag('p', get_string('savedata', 'report_user')); $returnurl = new moodle_url('/', array()); echo $OUTPUT->single_button($returnurl, get_string('continue')); } else { echo html_writer::tag('h3', $USER->firstname . ' ' . $USER->lastname, array('class' => 'title-username')); echo html_writer::tag('p', 'Bienvenido al Campus BCP, es necesario que completes tus datos para ayudarte en cualquier consulta que tengas', array('id' => 'message-user-edit')); $mform->display(); } echo $OUTPUT->footer();