2009-09-25 04:02:46 +00:00
|
|
|
<?php
|
|
|
|
// This file is part of Moodle - http://moodle.org/
|
|
|
|
//
|
|
|
|
// Moodle is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
|
|
// (at your option) any later version.
|
|
|
|
//
|
|
|
|
// Moodle is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License for more details.
|
|
|
|
//
|
|
|
|
// You should have received a copy of the GNU General Public License
|
|
|
|
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Allows you 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
|
2014-02-18 10:12:42 +13:00
|
|
|
* @package core_user
|
2009-09-25 04:02:46 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
require_once('../config.php');
|
|
|
|
require_once($CFG->libdir.'/gdlib.php');
|
|
|
|
require_once($CFG->dirroot.'/user/edit_form.php');
|
|
|
|
require_once($CFG->dirroot.'/user/editlib.php');
|
|
|
|
require_once($CFG->dirroot.'/user/profile/lib.php');
|
2013-08-19 17:03:39 +08:00
|
|
|
require_once($CFG->dirroot.'/user/lib.php');
|
2009-09-25 04:02:46 +00:00
|
|
|
|
2014-02-18 10:12:42 +13:00
|
|
|
// HTTPS is required in this page when $CFG->loginhttps enabled.
|
2010-10-10 15:04:19 +00:00
|
|
|
$PAGE->https_required();
|
2009-09-25 04:02:46 +00:00
|
|
|
|
2014-02-18 10:12:42 +13:00
|
|
|
$userid = optional_param('id', $USER->id, PARAM_INT); // User id.
|
|
|
|
$course = optional_param('course', SITEID, PARAM_INT); // Course id (defaults to Site).
|
2015-05-07 14:30:48 +08:00
|
|
|
$returnto = optional_param('returnto', null, PARAM_ALPHA); // Code determining where to return to after save.
|
2014-02-18 10:12:42 +13:00
|
|
|
$cancelemailchange = optional_param('cancelemailchange', 0, PARAM_INT); // Course id (defaults to Site).
|
2009-09-25 04:02:46 +00:00
|
|
|
|
2014-02-18 10:12:42 +13:00
|
|
|
$PAGE->set_url('/user/edit.php', array('course' => $course, 'id' => $userid));
|
2009-09-25 04:02:46 +00:00
|
|
|
|
2014-02-18 10:12:42 +13:00
|
|
|
if (!$course = $DB->get_record('course', array('id' => $course))) {
|
2009-09-25 04:02:46 +00:00
|
|
|
print_error('invalidcourseid');
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($course->id != SITEID) {
|
|
|
|
require_login($course);
|
|
|
|
} else if (!isloggedin()) {
|
|
|
|
if (empty($SESSION->wantsurl)) {
|
|
|
|
$SESSION->wantsurl = $CFG->httpswwwroot.'/user/edit.php';
|
2007-01-04 03:01:30 +00:00
|
|
|
}
|
2009-09-25 04:02:46 +00:00
|
|
|
redirect(get_login_url());
|
|
|
|
} else {
|
2013-07-03 14:39:10 +08:00
|
|
|
$PAGE->set_context(context_system::instance());
|
2009-09-25 04:02:46 +00:00
|
|
|
}
|
|
|
|
|
2014-02-18 10:12:42 +13:00
|
|
|
// Guest can not edit.
|
2009-09-25 04:02:46 +00:00
|
|
|
if (isguestuser()) {
|
|
|
|
print_error('guestnoeditprofile');
|
|
|
|
}
|
|
|
|
|
2014-02-18 10:12:42 +13:00
|
|
|
// The user profile we are editing.
|
|
|
|
if (!$user = $DB->get_record('user', array('id' => $userid))) {
|
2009-09-25 04:02:46 +00:00
|
|
|
print_error('invaliduserid');
|
|
|
|
}
|
|
|
|
|
2014-02-18 10:12:42 +13:00
|
|
|
// Guest can not be edited.
|
2009-09-25 04:02:46 +00:00
|
|
|
if (isguestuser($user)) {
|
|
|
|
print_error('guestnoeditprofile');
|
|
|
|
}
|
|
|
|
|
2014-02-18 10:12:42 +13:00
|
|
|
// User interests separated by commas.
|
2015-09-05 23:09:19 +08:00
|
|
|
$user->interests = core_tag_tag::get_item_tags_array('core', 'user', $user->id);
|
2009-09-25 04:02:46 +00:00
|
|
|
|
2014-02-18 10:12:42 +13:00
|
|
|
// Remote users cannot be edited.
|
2009-09-25 04:02:46 +00:00
|
|
|
if (is_mnet_remote_user($user)) {
|
2010-01-12 02:58:53 +00:00
|
|
|
if (user_not_fully_set_up($user)) {
|
2014-02-18 10:12:42 +13:00
|
|
|
$hostwwwroot = $DB->get_field('mnet_host', 'wwwroot', array('id' => $user->mnethostid));
|
2010-01-12 02:58:53 +00:00
|
|
|
print_error('usernotfullysetup', 'mnet', '', $hostwwwroot);
|
|
|
|
}
|
2009-09-25 04:02:46 +00:00
|
|
|
redirect($CFG->wwwroot . "/user/view.php?course={$course->id}");
|
|
|
|
}
|
|
|
|
|
2014-02-18 10:12:42 +13:00
|
|
|
// Load the appropriate auth plugin.
|
2010-08-18 22:07:00 +00:00
|
|
|
$userauth = get_auth_plugin($user->auth);
|
|
|
|
|
|
|
|
if (!$userauth->can_edit_profile()) {
|
|
|
|
print_error('noprofileedit', 'auth');
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($editurl = $userauth->edit_profile_url()) {
|
2014-02-18 10:12:42 +13:00
|
|
|
// This internal script not used.
|
2010-08-18 22:07:00 +00:00
|
|
|
redirect($editurl);
|
|
|
|
}
|
|
|
|
|
2009-09-25 04:02:46 +00:00
|
|
|
if ($course->id == SITEID) {
|
2014-02-18 10:12:42 +13:00
|
|
|
$coursecontext = context_system::instance(); // SYSTEM context.
|
2009-09-25 04:02:46 +00:00
|
|
|
} else {
|
2014-02-18 10:12:42 +13:00
|
|
|
$coursecontext = context_course::instance($course->id); // Course context.
|
2009-09-25 04:02:46 +00:00
|
|
|
}
|
2012-07-26 11:38:02 +08:00
|
|
|
$systemcontext = context_system::instance();
|
|
|
|
$personalcontext = context_user::instance($user->id);
|
2009-09-25 04:02:46 +00:00
|
|
|
|
2014-02-18 10:12:42 +13:00
|
|
|
// Check access control.
|
2009-09-25 04:02:46 +00:00
|
|
|
if ($user->id == $USER->id) {
|
2014-02-18 10:12:42 +13:00
|
|
|
// Editing own profile - require_login() MUST NOT be used here, it would result in infinite loop!
|
2009-09-25 04:02:46 +00:00
|
|
|
if (!has_capability('moodle/user:editownprofile', $systemcontext)) {
|
|
|
|
print_error('cannotedityourprofile');
|
2008-01-09 16:46:21 +00:00
|
|
|
}
|
2007-04-26 21:41:08 +00:00
|
|
|
|
2009-09-25 04:02:46 +00:00
|
|
|
} else {
|
2014-02-18 10:12:42 +13:00
|
|
|
// Teachers, parents, etc.
|
2009-09-25 04:02:46 +00:00
|
|
|
require_capability('moodle/user:editprofile', $personalcontext);
|
2014-02-18 10:12:42 +13:00
|
|
|
// No editing of guest user account.
|
2009-09-25 04:02:46 +00:00
|
|
|
if (isguestuser($user->id)) {
|
|
|
|
print_error('guestnoeditprofileother');
|
2007-03-14 23:37:28 +00:00
|
|
|
}
|
2014-02-18 10:12:42 +13:00
|
|
|
// No editing of primary admin!
|
|
|
|
if (is_siteadmin($user) and !is_siteadmin($USER)) { // Only admins may edit other admins.
|
2010-08-12 09:44:28 +00:00
|
|
|
print_error('useradmineditadmin');
|
2008-07-05 14:52:39 +00:00
|
|
|
}
|
2009-09-25 04:02:46 +00:00
|
|
|
}
|
2008-07-05 14:52:39 +00:00
|
|
|
|
2009-09-25 04:02:46 +00:00
|
|
|
if ($user->deleted) {
|
|
|
|
echo $OUTPUT->header();
|
|
|
|
echo $OUTPUT->heading(get_string('userdeleted'));
|
|
|
|
echo $OUTPUT->footer();
|
|
|
|
die;
|
|
|
|
}
|
2008-07-05 22:46:31 +00:00
|
|
|
|
2014-06-30 16:36:49 +08:00
|
|
|
$PAGE->set_pagelayout('admin');
|
|
|
|
$PAGE->set_context($personalcontext);
|
|
|
|
if ($USER->id != $user->id) {
|
|
|
|
$PAGE->navigation->extend_for_user($user);
|
|
|
|
} else {
|
|
|
|
if ($node = $PAGE->navigation->find('myprofile', navigation_node::TYPE_ROOTNODE)) {
|
|
|
|
$node->force_open();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-02-18 10:12:42 +13:00
|
|
|
// Process email change cancellation.
|
2009-09-25 04:02:46 +00:00
|
|
|
if ($cancelemailchange) {
|
|
|
|
cancel_email_update($user->id);
|
|
|
|
}
|
2007-01-26 18:42:47 +00:00
|
|
|
|
2014-02-18 10:12:42 +13:00
|
|
|
// Load user preferences.
|
2009-09-25 04:02:46 +00:00
|
|
|
useredit_load_preferences($user);
|
2001-11-22 06:23:56 +00:00
|
|
|
|
2014-02-18 10:12:42 +13:00
|
|
|
// Load custom profile fields data.
|
2009-09-25 04:02:46 +00:00
|
|
|
profile_load_data($user);
|
2007-08-17 19:09:11 +00:00
|
|
|
|
2007-01-05 02:18:53 +00:00
|
|
|
|
2014-02-18 10:12:42 +13:00
|
|
|
// Prepare the editor and create form.
|
2011-07-12 10:45:55 +08:00
|
|
|
$editoroptions = array(
|
|
|
|
'maxfiles' => EDITOR_UNLIMITED_FILES,
|
|
|
|
'maxbytes' => $CFG->maxbytes,
|
|
|
|
'trusttext' => false,
|
|
|
|
'forcehttps' => false,
|
|
|
|
'context' => $personalcontext
|
|
|
|
);
|
|
|
|
|
2010-07-03 13:37:13 +00:00
|
|
|
$user = file_prepare_standard_editor($user, 'description', $editoroptions, $personalcontext, 'user', 'profile', 0);
|
2012-06-13 17:27:17 +08:00
|
|
|
// Prepare filemanager draft area.
|
|
|
|
$draftitemid = 0;
|
|
|
|
$filemanagercontext = $editoroptions['context'];
|
|
|
|
$filemanageroptions = array('maxbytes' => $CFG->maxbytes,
|
|
|
|
'subdirs' => 0,
|
|
|
|
'maxfiles' => 1,
|
|
|
|
'accepted_types' => 'web_image');
|
|
|
|
file_prepare_draft_area($draftitemid, $filemanagercontext->id, 'user', 'newicon', 0, $filemanageroptions);
|
|
|
|
$user->imagefile = $draftitemid;
|
2014-02-18 10:12:42 +13:00
|
|
|
// Create form.
|
2015-05-07 14:30:48 +08:00
|
|
|
$userform = new user_edit_form(new moodle_url($PAGE->url, array('returnto' => $returnto)), array(
|
2012-06-13 17:27:17 +08:00
|
|
|
'editoroptions' => $editoroptions,
|
2012-05-15 21:53:09 +04:00
|
|
|
'filemanageroptions' => $filemanageroptions,
|
2015-03-28 18:46:16 +13:00
|
|
|
'user' => $user));
|
2008-07-05 14:28:13 +00:00
|
|
|
|
2014-02-18 10:12:42 +13:00
|
|
|
$emailchanged = false;
|
2007-07-31 08:09:46 +00:00
|
|
|
|
2009-09-25 04:02:46 +00:00
|
|
|
if ($usernew = $userform->get_data()) {
|
2001-11-22 06:23:56 +00:00
|
|
|
|
2015-05-07 14:30:48 +08:00
|
|
|
// Deciding where to send the user back in most cases.
|
|
|
|
if ($returnto === 'profile') {
|
|
|
|
if ($course->id != SITEID) {
|
|
|
|
$returnurl = new moodle_url('/user/view.php', array('id' => $user->id, 'course' => $course->id));
|
|
|
|
} else {
|
|
|
|
$returnurl = new moodle_url('/user/profile.php', array('id' => $user->id));
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
$returnurl = new moodle_url('/user/preferences.php', array('userid' => $user->id));
|
|
|
|
}
|
|
|
|
|
2014-02-18 10:12:42 +13:00
|
|
|
$emailchangedhtml = '';
|
2008-07-05 14:28:13 +00:00
|
|
|
|
2009-09-25 04:02:46 +00:00
|
|
|
if ($CFG->emailchangeconfirmation) {
|
2014-02-18 10:12:42 +13:00
|
|
|
// Users with 'moodle/user:update' can change their email address immediately.
|
|
|
|
// Other users require a confirmation email.
|
2009-09-25 04:02:46 +00:00
|
|
|
if (isset($usernew->email) and $user->email != $usernew->email && !has_capability('moodle/user:update', $systemcontext)) {
|
|
|
|
$a = new stdClass();
|
|
|
|
$a->newemail = $usernew->preference_newemail = $usernew->email;
|
|
|
|
$usernew->preference_newemailkey = random_string(20);
|
|
|
|
$usernew->preference_newemailattemptsleft = 3;
|
|
|
|
$a->oldemail = $usernew->email = $user->email;
|
|
|
|
|
2014-02-18 10:12:42 +13:00
|
|
|
$emailchangedhtml = $OUTPUT->box(get_string('auth_changingemailaddress', 'auth', $a), 'generalbox', 'notice');
|
2015-05-07 14:30:48 +08:00
|
|
|
$emailchangedhtml .= $OUTPUT->continue_button($returnurl);
|
2014-02-18 10:12:42 +13:00
|
|
|
$emailchanged = true;
|
2008-07-05 14:28:13 +00:00
|
|
|
}
|
2009-09-25 04:02:46 +00:00
|
|
|
}
|
2008-07-05 14:28:13 +00:00
|
|
|
|
2009-09-25 04:02:46 +00:00
|
|
|
$authplugin = get_auth_plugin($user->auth);
|
2002-08-08 14:17:55 +00:00
|
|
|
|
2009-09-25 04:02:46 +00:00
|
|
|
$usernew->timemodified = time();
|
2010-04-20 03:42:55 +00:00
|
|
|
|
2014-02-18 10:12:42 +13:00
|
|
|
// Description editor element may not exist!
|
2015-02-11 09:44:33 +01:00
|
|
|
if (isset($usernew->description_editor) && isset($usernew->description_editor['format'])) {
|
2010-07-03 13:37:13 +00:00
|
|
|
$usernew = file_postupdate_standard_editor($usernew, 'description', $editoroptions, $personalcontext, 'user', 'profile', 0);
|
2010-04-20 03:42:55 +00:00
|
|
|
}
|
2004-09-21 11:41:58 +00:00
|
|
|
|
2013-08-19 17:03:39 +08:00
|
|
|
// Pass a true old $user here.
|
|
|
|
if (!$authplugin->user_update($user, $usernew)) {
|
|
|
|
// Auth update failed.
|
2009-09-25 04:02:46 +00:00
|
|
|
print_error('cannotupdateprofile');
|
|
|
|
}
|
2007-03-22 12:27:52 +00:00
|
|
|
|
2013-08-19 17:03:39 +08:00
|
|
|
// Update user with new profile data.
|
2014-06-10 10:38:11 +08:00
|
|
|
user_update_user($usernew, false, false);
|
2013-08-19 17:03:39 +08:00
|
|
|
|
2014-02-18 10:12:42 +13:00
|
|
|
// Update preferences.
|
2009-09-25 04:02:46 +00:00
|
|
|
useredit_update_user_preference($usernew);
|
2007-08-17 19:09:11 +00:00
|
|
|
|
2014-02-18 10:12:42 +13:00
|
|
|
// Update interests.
|
2015-09-05 23:09:19 +08:00
|
|
|
if (isset($usernew->interests)) {
|
2009-09-25 04:02:46 +00:00
|
|
|
useredit_update_interests($usernew, $usernew->interests);
|
|
|
|
}
|
2007-08-17 19:09:11 +00:00
|
|
|
|
2014-02-18 10:12:42 +13:00
|
|
|
// Update user picture.
|
2013-03-22 16:51:18 +01:00
|
|
|
if (empty($CFG->disableuserimages)) {
|
2012-06-13 17:27:17 +08:00
|
|
|
useredit_update_picture($usernew, $userform, $filemanageroptions);
|
2009-09-25 04:02:46 +00:00
|
|
|
}
|
2006-05-21 20:21:35 +00:00
|
|
|
|
2014-02-18 10:12:42 +13:00
|
|
|
// Update mail bounces.
|
2009-09-25 04:02:46 +00:00
|
|
|
useredit_update_bounces($user, $usernew);
|
2002-08-14 01:51:58 +00:00
|
|
|
|
2014-02-18 10:12:42 +13:00
|
|
|
// Update forum track preference.
|
2009-09-25 04:02:46 +00:00
|
|
|
useredit_update_trackforums($user, $usernew);
|
2001-11-22 06:23:56 +00:00
|
|
|
|
2014-02-18 10:12:42 +13:00
|
|
|
// Save custom profile fields data.
|
2009-09-25 04:02:46 +00:00
|
|
|
profile_save_data($usernew);
|
2005-03-20 12:02:14 +00:00
|
|
|
|
2014-06-10 10:38:11 +08:00
|
|
|
// Trigger event.
|
|
|
|
\core\event\user_updated::create_from_userid($user->id)->trigger();
|
|
|
|
|
2013-09-23 21:15:19 +02:00
|
|
|
// If email was changed and confirmation is required, send confirmation email now to the new address.
|
2014-02-18 10:12:42 +13:00
|
|
|
if ($emailchanged && $CFG->emailchangeconfirmation) {
|
|
|
|
$tempuser = $DB->get_record('user', array('id' => $user->id), '*', MUST_EXIST);
|
|
|
|
$tempuser->email = $usernew->preference_newemail;
|
2008-07-05 14:28:13 +00:00
|
|
|
|
2009-09-25 04:02:46 +00:00
|
|
|
$a = new stdClass();
|
|
|
|
$a->url = $CFG->wwwroot . '/user/emailupdate.php?key=' . $usernew->preference_newemailkey . '&id=' . $user->id;
|
2012-07-26 11:38:02 +08:00
|
|
|
$a->site = format_string($SITE->fullname, true, array('context' => context_course::instance(SITEID)));
|
2014-02-18 10:12:42 +13:00
|
|
|
$a->fullname = fullname($tempuser, true);
|
2008-07-05 14:28:13 +00:00
|
|
|
|
MDL-26795 fix incorrect location of email change strings
AMOS BEGIN
MOV [auth_emailchangecancel,auth_email],[emailchangecancel,core_auth]
MOV [auth_emailchangepending,auth_email],[emailchangepending,core_auth]
MOV [auth_emailupdate,auth_email],[emailupdate,core_auth]
MOV [auth_emailnowexists,auth_email],[emailnowexists,core_auth]
MOV [auth_emailupdatemessage,auth_email],[emailupdatemessage,core_auth]
MOV [auth_emailupdatesuccess,auth_email],[emailupdatesuccess,core_auth]
MOV [auth_emailupdatetitle,auth_email],[emailupdatetitle,core_auth]
CPY [auth_emailnoemail,auth_email],[noemail,auth_ldap]
AMOS END
2011-03-27 17:19:23 +02:00
|
|
|
$emailupdatemessage = get_string('emailupdatemessage', 'auth', $a);
|
|
|
|
$emailupdatetitle = get_string('emailupdatetitle', 'auth', $a);
|
2008-07-05 14:28:13 +00:00
|
|
|
|
2014-02-18 10:12:42 +13:00
|
|
|
// Email confirmation directly rather than using messaging so they will definitely get an email.
|
2013-08-30 15:21:37 +08:00
|
|
|
$supportuser = core_user::get_support_user();
|
2014-02-18 10:12:42 +13:00
|
|
|
if (!$mailresults = email_to_user($tempuser, $supportuser, $emailupdatetitle, $emailupdatemessage)) {
|
2009-09-25 04:02:46 +00:00
|
|
|
die("could not send email!");
|
2008-07-05 14:28:13 +00:00
|
|
|
}
|
2009-09-25 04:02:46 +00:00
|
|
|
}
|
2008-07-05 14:28:13 +00:00
|
|
|
|
2013-09-23 21:15:59 +02:00
|
|
|
// Reload from db, we need new full name on this page if we do not redirect.
|
2014-02-18 10:12:42 +13:00
|
|
|
$user = $DB->get_record('user', array('id' => $user->id), '*', MUST_EXIST);
|
2008-07-05 14:28:13 +00:00
|
|
|
|
2009-09-25 04:02:46 +00:00
|
|
|
if ($USER->id == $user->id) {
|
2014-02-18 10:12:42 +13:00
|
|
|
// Override old $USER session variable if needed.
|
2013-09-23 21:15:59 +02:00
|
|
|
foreach ((array)$user as $variable => $value) {
|
|
|
|
if ($variable === 'description' or $variable === 'password') {
|
|
|
|
// These are not set for security nad perf reasons.
|
|
|
|
continue;
|
|
|
|
}
|
2009-09-25 04:02:46 +00:00
|
|
|
$USER->$variable = $value;
|
2008-07-05 14:28:13 +00:00
|
|
|
}
|
2014-02-18 10:12:42 +13:00
|
|
|
// Preload custom fields.
|
2010-07-25 21:00:59 +00:00
|
|
|
profile_load_custom_fields($USER);
|
2003-05-06 15:58:20 +00:00
|
|
|
}
|
|
|
|
|
2010-07-30 14:47:15 +00:00
|
|
|
if (is_siteadmin() and empty($SITE->shortname)) {
|
2014-02-18 10:12:42 +13:00
|
|
|
// Fresh cli install - we need to finish site settings.
|
2010-07-30 14:47:15 +00:00
|
|
|
redirect(new moodle_url('/admin/index.php'));
|
|
|
|
}
|
|
|
|
|
2014-02-18 10:12:42 +13:00
|
|
|
if (!$emailchanged || !$CFG->emailchangeconfirmation) {
|
2015-05-07 14:30:48 +08:00
|
|
|
redirect($returnurl);
|
2008-01-09 16:46:21 +00:00
|
|
|
}
|
2009-09-25 04:02:46 +00:00
|
|
|
}
|
2007-08-17 19:09:11 +00:00
|
|
|
|
2014-02-18 10:12:42 +13:00
|
|
|
// Make sure we really are on the https page when https login required.
|
2010-10-10 15:04:19 +00:00
|
|
|
$PAGE->verify_https_required();
|
|
|
|
|
2006-04-16 16:49:28 +00:00
|
|
|
|
2014-02-18 10:12:42 +13:00
|
|
|
// Display page header.
|
2009-09-25 04:02:46 +00:00
|
|
|
$streditmyprofile = get_string('editmyprofile');
|
|
|
|
$strparticipants = get_string('participants');
|
|
|
|
$userfullname = fullname($user, true);
|
|
|
|
|
|
|
|
$PAGE->set_title("$course->shortname: $streditmyprofile");
|
2015-03-16 13:13:07 +08:00
|
|
|
$PAGE->set_heading($userfullname);
|
2009-09-25 04:02:46 +00:00
|
|
|
|
|
|
|
echo $OUTPUT->header();
|
2012-10-16 13:16:41 +08:00
|
|
|
echo $OUTPUT->heading($userfullname);
|
2009-09-25 04:02:46 +00:00
|
|
|
|
2014-02-18 10:12:42 +13:00
|
|
|
if ($emailchanged) {
|
|
|
|
echo $emailchangedhtml;
|
2009-09-25 04:02:46 +00:00
|
|
|
} else {
|
2014-02-18 10:12:42 +13:00
|
|
|
// Finally display THE form.
|
2009-09-25 04:02:46 +00:00
|
|
|
$userform->display();
|
|
|
|
}
|
2004-09-23 03:56:53 +00:00
|
|
|
|
2014-02-18 10:12:42 +13:00
|
|
|
// And proper footer.
|
2009-09-25 04:02:46 +00:00
|
|
|
echo $OUTPUT->footer();
|
2003-05-06 15:58:20 +00:00
|
|
|
|