2 if (!isset($user->htmleditor
)) {
5 if (!isset($user->ajax
)) {
8 if (!isset($user->picture
)) {
11 if (empty($user->lang
)) {
12 $user->lang
= $CFG->lang
;
14 if (!isset($user->theme
)) {
17 if (!isset($user->trackforums
)) {
18 $user->trackforums
= 0;
23 <form method=
"post" name=
"form" enctype=
"multipart/form-data" action=
"edit.php">
24 <table class=
"formtable">
26 if (has_capability('moodle/user:update', get_context_instance(CONTEXT_SYSTEM
, SITEID
))) {
27 $theadmin = get_admin(); // returns false during install
28 $adminself = (!empty($theadmin) and ($theadmin->id
== $USER->id
) and ($USER->id
== $user->id
));
30 echo '<th>'.get_string('username').':</th>';
31 if ($adminself ||
is_internal_auth($user->auth
) ){
32 echo "<td><input type=\"text\" name=\"username\" size=\"20\" alt=\"".get_string("username")."\" value=\"";
35 if (isset($err["username"])) formerr($err["username"]);
39 echo "<input type=\"hidden\" name=\"username\" value=\"";
46 $modules = get_list_of_plugins("auth");
47 $auth_options = array();
48 foreach ($modules as $module) {
49 $auth_options[$module] = get_string("auth_$module"."title", "auth");
51 if (!$adminself) { /// Main admin is ALWAYS default manual
53 echo '<th>'.get_string("chooseauthmethod","auth").':</th>' . "\n<td>";
54 choose_from_menu ($auth_options, 'auth', $user->auth
);
55 helpbutton('authchange', get_string('chooseauthmethod', 'auth'));
59 if ($adminself ||
is_internal_auth($user->auth
) ||
(!empty($CFG->{'auth_'.$user->auth
.'_stdchangepassword'}))) {
61 echo '<th>'.get_string('newpassword').':</th>';
62 echo "<td><input type=\"text\" name=\"newpassword\" size=\"20\" alt=\"".get_string("newpassword")."\" value=\"";
63 if (isset($user->newpassword
)) {
64 p($user->newpassword
);
67 if (isset($err["newpassword"])) {
68 formerr($err["newpassword"]);
69 } else if (empty($user->newpassword
)) {
70 echo " (".get_string("leavetokeep").")";
74 if (!$adminself && (!empty($CFG->{'auth_'.$user->auth
.'_stdchangepassword'}) ||
is_internal_auth())){
75 if (get_user_preferences('auth_forcepasswordchange', NULL, $user->id
)) {
76 $checked = ' checked="checked" ';
81 echo '<th>'.get_string('forcepasswordchange').':</th>';
82 echo '<td><input type="checkbox" name="forcepasswordchange" alt="'.get_string('forcepasswordchange').'" '.$checked.' /> '.get_string('forcepasswordchangehelp').'</td>';
86 echo '<tr><td colspan="2"><hr /></td></tr>';
92 <th><?php print_string("firstname") ?>:
</th>
94 <input type=
"text" name=
"firstname" size=
"30" alt=
"<?php print_string("firstname
") ?>" maxlength
="100" value
="<?php p($user->firstname) ?>" />
95 <?php
if (isset($err["firstname"])) formerr($err["firstname"]); ?>
99 <th><?php print_string("lastname") ?>:
</th>
101 <input type=
"text" name=
"lastname" size=
"30" alt=
"<?php print_string("lastname
") ?>" maxlength
="100" value
="<?php p($user->lastname) ?>" />
102 <?php
if (isset($err["lastname"])) formerr($err["lastname"]); ?>
106 <th><?php print_string("email") ?>:
</th>
108 <input type=
"text" name=
"email" size=
"30" alt=
"<?php print_string("email
") ?>" maxlength
="100" value
="<?php p($user->email) ?>" />
109 <?php
if (isset($err["email"])) formerr($err["email"]); ?>
113 <th><?php print_string("emaildisplay") ?>:
</th>
116 $choices["0"] = get_string("emaildisplayno");
117 $choices["1"] = get_string("emaildisplayyes");
118 $choices["2"] = get_string("emaildisplaycourse");
119 choose_from_menu ($choices, "maildisplay", $user->maildisplay
, "") ?>
123 <th><?php print_string("emailactive") ?>:
</th>
126 $choices["0"] = get_string("emailenable");
127 $choices["1"] = get_string("emaildisable");
128 choose_from_menu ($choices, "emailstop", $user->emailstop
, "") ?>
132 <th><?php print_string("emailformat") ?>:
</th>
135 $choices["0"] = get_string("textformat");
136 $choices["1"] = get_string("htmlformat");
137 choose_from_menu ($choices, "mailformat", $user->mailformat
, "") ?>
140 <?php if (!empty($CFG->unicodedb
) && !empty($CFG->allowusermailcharset
)) { ?>
142 <th><?php print_string("emailcharset") ?>:
</th>
144 $mailcharset = get_user_preferences('mailcharset', '0', $user->id
);
147 $charsets = get_list_of_charsets();
148 if (!empty($CFG->sitemailcharset
)) {
149 $choices['0'] = get_string('site').' ('.$CFG->sitemailcharset
.')';
151 $choices['0'] = get_string('default').' ('.current_charset().')';
153 $choices = array_merge($choices, $charsets);
154 choose_from_menu($choices, 'mailcharset', $mailcharset, ''); ?>
159 <th><?php print_string('emaildigest') ?>:
</th>
162 $choices['0'] = get_string('emaildigestoff');
163 $choices['1'] = get_string('emaildigestcomplete');
164 $choices['2'] = get_string('emaildigestsubjects');
165 choose_from_menu ($choices, 'maildigest', $user->maildigest
, "") ?>
169 <th><?php print_string("autosubscribe") ?>:
</th>
172 $choices["1"] = get_string("autosubscribeyes");
173 $choices["0"] = get_string("autosubscribeno");
174 choose_from_menu ($choices, "autosubscribe", $user->autosubscribe
, "") ?>
177 <?php if (!empty($CFG->forum_trackreadposts
)) { ?>
179 <th><?php print_string("trackforums") ?>:
</th>
182 $choices["0"] = get_string("trackforumsno");
183 $choices["1"] = get_string("trackforumsyes");
184 choose_from_menu ($choices, "trackforums", $user->trackforums
, "") ?>
188 <?php if ($CFG->htmleditor
) { ?>
190 <th><?php print_string("textediting") ?>:
</th>
193 $choices["0"] = get_string("texteditor");
194 $choices["1"] = get_string("htmleditor");
195 choose_from_menu ($choices, "htmleditor", $user->htmleditor
, "") ?>
200 <th><?php print_string("ajaxuse") ?>:
</th>
203 $choices["0"] = get_string("ajaxno");
204 $choices["1"] = get_string("ajaxyes");
205 if (empty($CFG->enableajax
)) {
208 choose_from_menu ($choices, 'ajax', $user->ajax
, '', '', 0, false, empty($CFG->enableajax
)) ?>
212 <th><?php print_string("city") ?>:
</th>
214 <input type=
"text" name=
"city" size=
"25" alt=
"<?php print_string("city
") ?>" maxlength
="20" value
="<?php p($user->city) ?>" />
215 <?php
if (isset($err["city"])) formerr($err["city"]); ?>
219 <th><?php print_string("country") ?>:
</th>
223 if (!$user->country
and $CFG->country
) {
224 $user->country
= $CFG->country
;
227 choose_from_menu(get_list_of_countries(), "country", $user->country
, get_string("selectacountry")."...", "", "");
229 <?php if (isset($err["country"])) formerr($err["country"]); ?>
233 <th><?php print_string('timezone')?>:
</th>
236 $timezones = get_list_of_timezones();
237 if ($CFG->forcetimezone
!= 99) {
238 choose_from_menu($timezones, 'timezone', $CFG->forcetimezone
, get_string('serverlocaltime'), '', '99', false, true);
240 choose_from_menu($timezones, 'timezone', $user->timezone
, get_string('serverlocaltime'), '', '99');
246 <th><?php print_string("preferredlanguage") ?>:
</th>
247 <td><?php if ($languages = get_list_of_languages()) {
249 $user->lang
= $CFG->lang
;
251 choose_from_menu ($languages, "lang", $user->lang
, "", "", "");
253 if (isset($err["lang"])) formerr($err["lang"]);
257 <?php if (!empty($CFG->allowuserthemes
)) { ?>
259 <th><?php print_string("preferredtheme") ?>:
</th>
261 $themes[''] = get_string('default');
262 $themes +
= get_list_of_themes();
263 choose_from_menu($themes, 'theme', $user->theme
, "", "", "");
264 if (isset($err["theme"])) formerr($err["theme"]);
270 <th><?php print_string("userdescription") ?>:
</th>
272 if (isset($err["description"])) {
273 formerr($err["description"]);
276 print_textarea($usehtmleditor, 10, 50, 50, 10, 'description', "$user->description");
277 helpbutton("text", get_string("helptext"));
282 <td colspan=
"2" style=
"text-align: center;"><input type=
"submit" value=
"<?php print_string("updatemyprofile
") ?>" /></td
>
287 <td colspan
="2" align
="center"> <br
/><b
><?php
print_string("followingoptional") ?>:
</b></td>
292 $maxbytes = get_max_upload_file_size($CFG->maxbytes
, $course->maxbytes
);
293 if (!empty($CFG->gdversion
) and $maxbytes and (empty($CFG->disableuserimages
) or has_capability('moodle/user:update', get_context_instance(CONTEXT_SYSTEM
, SITEID
)))) {
296 <th><?php print_string("currentpicture") ?>:
</th>
298 <?php print_user_picture($user->id
, $course->id
, $user->picture
, false, false, false);
299 if ($user->picture
) {
300 echo ' <input type="checkbox" name="deletepicture" alt="'.get_string("delete").'" value="1" />';
301 print_string("delete");
307 <th><?php print_string("newpicture") ?>:
</th>
310 require_once($CFG->dirroot
.'/lib/uploadlib.php');
311 upload_print_form_fragment(1,array('imagefile'),null,false,null,0,0,false);
312 helpbutton("picture", get_string("helppicture"));
313 print_string("maxsize", "", display_size($maxbytes));
314 if (isset($err["imagefile"])) formerr($err["imagefile"]);
318 <?php } else if (empty($CFG->gdversion
) and has_capability('moodle/user:update', get_context_instance(CONTEXT_SYSTEM
, SITEID
))) { ?>
320 <th><?php print_string("newpicture") ?>:
</th>
323 echo "<a href=\"$CFG->wwwroot/$CFG->admin/config.php\">";
324 print_string('gdnot');
332 <th><?php print_string("webpage") ?>:
</th>
333 <td><input type=
"text" name=
"url" size=
"50" alt=
"<?php print_string("webpage
") ?>" maxlength
="255" value
="<?php p($user->url) ?>" />
334 <?php
if (isset($err["url"])) formerr($err["url"]); ?>
338 <th><?php print_string("icqnumber") ?>:
</th>
339 <td><input type=
"text" name=
"icq" size=
"25" alt=
"<?php print_string("icqnumber
") ?>" maxlength
="15" value
="<?php p($user->icq) ?>" />
340 <?php
if (isset($err["icq"])) formerr($err["icq"]); ?>
344 <th><?php print_string("skypeid") ?>:
</th>
345 <td><input type=
"text" name=
"skype" size=
"25" alt=
"<?php print_string("skypeid
") ?>" maxlength
="50" value
="<?php p($user->skype) ?>" />
346 <?php
if (isset($err["skype"])) formerr($err["skype"]); ?>
350 <th><?php print_string("aimid") ?>:
</th>
351 <td><input type=
"text" name=
"aim" size=
"25" alt=
"<?php print_string("aimid
") ?>" maxlength
="50" value
="<?php p($user->aim) ?>" />
352 <?php
if (isset($err["aim"])) formerr($err["aim"]); ?>
356 <th><?php print_string("yahooid") ?>:
</th>
357 <td><input type=
"text" name=
"yahoo" size=
"25" alt=
"<?php print_string("yahooid
") ?>" maxlength
="50" value
="<?php p($user->yahoo) ?>" />
358 <?php
if (isset($err["yahoo"])) formerr($err["yahoo"]); ?>
362 <th><?php print_string("msnid") ?>:
</th>
363 <td><input type=
"text" name=
"msn" size=
"25" alt=
"<?php print_string("msnid
") ?>" maxlength
="50" value
="<?php p($user->msn) ?>" />
364 <?php
if (isset($err["msn"])) formerr($err["msn"]); ?>
368 <th><?php print_string("idnumber") ?>:
</th>
370 <input type=
"text" name=
"idnumber" size=
"25" alt=
"<?php print_string("idnumber
") ?>" maxlength
="64" value
="<?php p($user->idnumber) ?>" /> <?php
p($teacheronly) ?>
371 <?php if (isset($err["idnumber"])) formerr($err["idnumber"]); ?>
374 <?php if (has_capability('moodle/user:update', get_context_instance(CONTEXT_SYSTEM
, SITEID
))) { ?>
376 <th><?php print_string("institution") ?>:
</th>
377 <td><input type=
"text" name=
"institution" size=
"25" alt=
"<?php print_string("institution
") ?>" maxlength
="40" value
="<?php p($user->institution) ?>" /> <?php
p($teacheronly) ?>
381 <th><?php print_string("department") ?>:
</th>
383 <input type=
"text" name=
"department" size=
"25" alt=
"<?php print_string("department
") ?>" maxlength
="30" value
="<?php p($user->department) ?>" /> <?php
p($teacheronly) ?>
388 <th><?php print_string("phone") ?> 1:
</th>
390 <input type=
"text" name=
"phone1" size=
"25" alt=
"<?php print_string("phone
") ?>" maxlength
="20" value
="<?php p($user->phone1) ?>" /> <?php
p($teacheronly) ?>
391 <?php if (isset($err["phone1"])) formerr($err["phone1"]); ?>
395 <th><?php print_string("phone") ?> 2:
</th>
397 <input type=
"text" name=
"phone2" size=
"25" alt=
"<?php print_string("phone
") ?>" maxlength
="20" value
="<?php p($user->phone2) ?>" /> <?php
p($teacheronly) ?>
398 <?php if (isset($err["phone2"])) formerr($err["phone2"]); ?>
402 <th><?php print_string("address") ?>:
</th>
404 <input type=
"text" name=
"address" size=
"25" alt=
"<?php print_string("address
") ?>" maxlength
="70" value
="<?php p($user->address) ?>" /> <?php
p($teacheronly) ?>
405 <?php if (isset($err["address"])) formerr($err["address"]); ?>
409 <td colspan=
"2" style=
"text-align: center;"><input type=
"submit" value=
"<?php print_string("updatemyprofile
") ?>" /></td
>
412 <input type
="hidden" name
="course" value
="<?php p($course->id) ?>" />
413 <input type
="hidden" name
="id" value
="<?php p($user->id) ?>" />
414 <input type
="hidden" name
="sesskey" value
="<?php p(sesskey()) ?>" />