2 if (!isset($user->htmleditor
)) {
5 if (!isset($user->picture
)) {
8 if (empty($user->lang
)) {
9 $user->lang
= $CFG->lang
;
11 if (!isset($user->theme
)) {
14 if (!isset($user->trackforums
)) {
15 $user->trackforums
= 0;
20 <form method=
"post" name=
"form" enctype=
"multipart/form-data" action=
"edit.php">
21 <table class=
"formtable">
24 $theadmin = get_admin();
25 $adminself = (($theadmin->id
== $USER->id
) and ($USER->id
== $user->id
));
27 echo '<th>'.get_string('username').':</th>';
28 if ($adminself ||
is_internal_auth($user->auth
) ){
29 echo "<td><input type=\"text\" name=\"username\" size=\"20\" alt=\"".get_string("username")."\" value=\"";
32 if (isset($err["username"])) formerr($err["username"]);
36 echo "<input type=\"hidden\" name=\"username\" value=\"";
43 $modules = get_list_of_plugins("auth");
44 $auth_options = array();
45 foreach ($modules as $module) {
46 $auth_options[$module] = get_string("auth_$module"."title", "auth");
48 if (!$adminself) { /// Main admin is ALWAYS default manual
50 echo '<th>'.get_string("chooseauthmethod","auth").':</th>' . "\n<td>";
51 choose_from_menu ($auth_options, 'auth', $user->auth
);
52 helpbutton('authchange', get_string('chooseauthmethod', 'auth'));
56 if ($adminself ||
is_internal_auth($user->auth
) ||
(!empty($CFG->{'auth_'.$user->auth
.'_stdchangepassword'}))) {
58 echo '<th>'.get_string('newpassword').':</th>';
59 echo "<td><input type=\"text\" name=\"newpassword\" size=\"20\" alt=\"".get_string("newpassword")."\" value=\"";
60 if (isset($user->newpassword
)) {
61 p($user->newpassword
);
64 if (isset($err["newpassword"])) {
65 formerr($err["newpassword"]);
66 } else if (empty($user->newpassword
)) {
67 echo " (".get_string("leavetokeep").")";
71 if (!$adminself && (!empty($CFG->{'auth_'.$user->auth
.'_stdchangepassword'}) ||
is_internal_auth())){
72 if (get_user_preferences('auth_forcepasswordchange', NULL, $user->id
)) {
73 $checked = ' checked="checked" ';
78 echo '<th>'.get_string('forcepasswordchange').':</th>';
79 echo '<td><input type="checkbox" name="forcepasswordchange" alt="'.get_string('forcepasswordchange').'" '.$checked.' /> '.get_string('forcepasswordchangehelp').'</td>';
83 echo '<tr><td colspan="2"><hr /></td></tr>';
89 <th><?php print_string("firstname") ?>:
</th>
91 <input type=
"text" name=
"firstname" size=
"30" alt=
"<?php print_string("firstname
") ?>" maxlength
="100" value
="<?php p($user->firstname) ?>" />
92 <?php
if (isset($err["firstname"])) formerr($err["firstname"]); ?>
96 <th><?php print_string("lastname") ?>:
</th>
98 <input type=
"text" name=
"lastname" size=
"30" alt=
"<?php print_string("lastname
") ?>" maxlength
="100" value
="<?php p($user->lastname) ?>" />
99 <?php
if (isset($err["lastname"])) formerr($err["lastname"]); ?>
103 <th><?php print_string("email") ?>:
</th>
105 <input type=
"text" name=
"email" size=
"30" alt=
"<?php print_string("email
") ?>" maxlength
="100" value
="<?php p($user->email) ?>" />
106 <?php
if (isset($err["email"])) formerr($err["email"]); ?>
110 <th><?php print_string("emaildisplay") ?>:
</th>
113 $choices["0"] = get_string("emaildisplayno");
114 $choices["1"] = get_string("emaildisplayyes");
115 $choices["2"] = get_string("emaildisplaycourse");
116 choose_from_menu ($choices, "maildisplay", $user->maildisplay
, "") ?>
120 <th><?php print_string("emailactive") ?>:
</th>
123 $choices["0"] = get_string("emailenable");
124 $choices["1"] = get_string("emaildisable");
125 choose_from_menu ($choices, "emailstop", $user->emailstop
, "") ?>
129 <th><?php print_string("emailformat") ?>:
</th>
132 $choices["0"] = get_string("textformat");
133 $choices["1"] = get_string("htmlformat");
134 choose_from_menu ($choices, "mailformat", $user->mailformat
, "") ?>
137 <?php if (!empty($CFG->unicodedb
) && !empty($CFG->allowusermailcharset
)) { ?>
139 <th><?php print_string("emailcharset") ?>:
</th>
141 $mailcharset = get_user_preferences('mailcharset', '0', $user->id
);
144 $charsets = get_list_of_charsets();
145 if (!empty($CFG->sitemailcharset
)) {
146 $choices['0'] = get_string('site').' ('.$CFG->sitemailcharset
.')';
148 $choices['0'] = get_string('default').' ('.current_charset().')';
150 $choices = array_merge($choices, $charsets);
151 choose_from_menu($choices, 'mailcharset', $mailcharset, ''); ?>
156 <th><?php print_string('emaildigest') ?>:
</th>
159 $choices['0'] = get_string('emaildigestoff');
160 $choices['1'] = get_string('emaildigestcomplete');
161 $choices['2'] = get_string('emaildigestsubjects');
162 choose_from_menu ($choices, 'maildigest', $user->maildigest
, "") ?>
166 <th><?php print_string("autosubscribe") ?>:
</th>
169 $choices["1"] = get_string("autosubscribeyes");
170 $choices["0"] = get_string("autosubscribeno");
171 choose_from_menu ($choices, "autosubscribe", $user->autosubscribe
, "") ?>
174 <?php if (!empty($CFG->forum_trackreadposts
)) { ?>
176 <th><?php print_string("trackforums") ?>:
</th>
179 $choices["0"] = get_string("trackforumsno");
180 $choices["1"] = get_string("trackforumsyes");
181 choose_from_menu ($choices, "trackforums", $user->trackforums
, "") ?>
185 <?php if ($CFG->htmleditor
) { ?>
187 <th><?php print_string("textediting") ?>:
</th>
190 $choices["0"] = get_string("texteditor");
191 $choices["1"] = get_string("htmleditor");
192 choose_from_menu ($choices, "htmleditor", $user->htmleditor
, "") ?>
197 <th><?php print_string("city") ?>:
</th>
199 <input type=
"text" name=
"city" size=
"25" alt=
"<?php print_string("city
") ?>" maxlength
="20" value
="<?php p($user->city) ?>" />
200 <?php
if (isset($err["city"])) formerr($err["city"]); ?>
204 <th><?php print_string("country") ?>:
</th>
208 if (!$user->country
and $CFG->country
) {
209 $user->country
= $CFG->country
;
212 choose_from_menu(get_list_of_countries(), "country", $user->country
, get_string("selectacountry")."...", "", "");
214 <?php if (isset($err["country"])) formerr($err["country"]); ?>
218 <th><?php print_string('timezone')?>:
</th>
221 $timezones = get_list_of_timezones();
222 if ($CFG->forcetimezone
!= 99) {
223 choose_from_menu($timezones, 'timezone', $CFG->forcetimezone
, get_string('serverlocaltime'), '', '99', false, true);
225 choose_from_menu($timezones, 'timezone', $user->timezone
, get_string('serverlocaltime'), '', '99');
231 <th><?php print_string("preferredlanguage") ?>:
</th>
232 <td><?php if ($languages = get_list_of_languages()) {
234 $user->lang
= $CFG->lang
;
236 choose_from_menu ($languages, "lang", $user->lang
, "", "", "");
238 if (isset($err["lang"])) formerr($err["lang"]);
242 <?php if (!empty($CFG->allowuserthemes
)) { ?>
244 <th><?php print_string("preferredtheme") ?>:
</th>
246 $themes[''] = get_string('default');
247 $themes +
= get_list_of_themes();
248 choose_from_menu($themes, 'theme', $user->theme
, "", "", "");
249 if (isset($err["theme"])) formerr($err["theme"]);
255 <th><?php print_string("userdescription") ?>:
</th>
257 if (isset($err["description"])) {
258 formerr($err["description"]);
261 print_textarea($usehtmleditor, 10, 50, 50, 10, 'description', "$user->description");
262 helpbutton("text", get_string("helptext"));
267 <td colspan=
"2" style=
"text-align: center;"><input type=
"submit" value=
"<?php print_string("updatemyprofile
") ?>" /></td
>
272 <td colspan
="2" align
="center"> <br
/><b
><?php
print_string("followingoptional") ?>:
</b></td>
277 $maxbytes = get_max_upload_file_size($CFG->maxbytes
, $course->maxbytes
);
278 if (!empty($CFG->gdversion
) and $maxbytes and (empty($CFG->disableuserimages
) or isadmin())) {
281 <th><?php print_string("currentpicture") ?>:
</th>
283 <?php print_user_picture($user->id
, $course->id
, $user->picture
, false, false, false);
284 if ($user->picture
) {
285 echo ' <input type="checkbox" name="deletepicture" alt="'.get_string("delete").'" value="1" />';
286 print_string("delete");
292 <th><?php print_string("newpicture") ?>:
</th>
295 require_once($CFG->dirroot
.'/lib/uploadlib.php');
296 upload_print_form_fragment(1,array('imagefile'),null,false,null,0,0,false);
297 helpbutton("picture", get_string("helppicture"));
298 print_string("maxsize", "", display_size($maxbytes));
299 if (isset($err["imagefile"])) formerr($err["imagefile"]);
303 <?php } else if (empty($CFG->gdversion
) and isadmin()) { ?>
305 <th><?php print_string("newpicture") ?>:
</th>
308 echo "<a href=\"$CFG->wwwroot/$CFG->admin/config.php\">";
309 print_string('gdnot');
317 <th><?php print_string("webpage") ?>:
</th>
318 <td><input type=
"text" name=
"url" size=
"50" alt=
"<?php print_string("webpage
") ?>" maxlength
="255" value
="<?php p($user->url) ?>" />
319 <?php
if (isset($err["url"])) formerr($err["url"]); ?>
323 <th><?php print_string("icqnumber") ?>:
</th>
324 <td><input type=
"text" name=
"icq" size=
"25" alt=
"<?php print_string("icqnumber
") ?>" maxlength
="15" value
="<?php p($user->icq) ?>" />
325 <?php
if (isset($err["icq"])) formerr($err["icq"]); ?>
329 <th><?php print_string("skypeid") ?>:
</th>
330 <td><input type=
"text" name=
"skype" size=
"25" alt=
"<?php print_string("skypeid
") ?>" maxlength
="50" value
="<?php p($user->skype) ?>" />
331 <?php
if (isset($err["skype"])) formerr($err["skype"]); ?>
335 <th><?php print_string("aimid") ?>:
</th>
336 <td><input type=
"text" name=
"aim" size=
"25" alt=
"<?php print_string("aimid
") ?>" maxlength
="50" value
="<?php p($user->aim) ?>" />
337 <?php
if (isset($err["aim"])) formerr($err["aim"]); ?>
341 <th><?php print_string("yahooid") ?>:
</th>
342 <td><input type=
"text" name=
"yahoo" size=
"25" alt=
"<?php print_string("yahooid
") ?>" maxlength
="50" value
="<?php p($user->yahoo) ?>" />
343 <?php
if (isset($err["yahoo"])) formerr($err["yahoo"]); ?>
347 <th><?php print_string("msnid") ?>:
</th>
348 <td><input type=
"text" name=
"msn" size=
"25" alt=
"<?php print_string("msnid
") ?>" maxlength
="50" value
="<?php p($user->msn) ?>" />
349 <?php
if (isset($err["msn"])) formerr($err["msn"]); ?>
353 <th><?php print_string("idnumber") ?>:
</th>
355 <input type=
"text" name=
"idnumber" size=
"25" alt=
"<?php print_string("idnumber
") ?>" maxlength
="64" value
="<?php p($user->idnumber) ?>" /> <?php
p($teacheronly) ?>
356 <?php if (isset($err["idnumber"])) formerr($err["idnumber"]); ?>
359 <?php if (isadmin()) { ?>
361 <th><?php print_string("institution") ?>:
</th>
362 <td><input type=
"text" name=
"institution" size=
"25" alt=
"<?php print_string("institution
") ?>" maxlength
="40" value
="<?php p($user->institution) ?>" /> <?php
p($teacheronly) ?>
366 <th><?php print_string("department") ?>:
</th>
368 <input type=
"text" name=
"department" size=
"25" alt=
"<?php print_string("department
") ?>" maxlength
="30" value
="<?php p($user->department) ?>" /> <?php
p($teacheronly) ?>
373 <th><?php print_string("phone") ?> 1:
</th>
375 <input type=
"text" name=
"phone1" size=
"25" alt=
"<?php print_string("phone
") ?>" maxlength
="20" value
="<?php p($user->phone1) ?>" /> <?php
p($teacheronly) ?>
376 <?php if (isset($err["phone1"])) formerr($err["phone1"]); ?>
380 <th><?php print_string("phone") ?> 2:
</th>
382 <input type=
"text" name=
"phone2" size=
"25" alt=
"<?php print_string("phone
") ?>" maxlength
="20" value
="<?php p($user->phone2) ?>" /> <?php
p($teacheronly) ?>
383 <?php if (isset($err["phone2"])) formerr($err["phone2"]); ?>
387 <th><?php print_string("address") ?>:
</th>
389 <input type=
"text" name=
"address" size=
"25" alt=
"<?php print_string("address
") ?>" maxlength
="70" value
="<?php p($user->address) ?>" /> <?php
p($teacheronly) ?>
390 <?php if (isset($err["address"])) formerr($err["address"]); ?>
394 <td colspan=
"2" style=
"text-align: center;"><input type=
"submit" value=
"<?php print_string("updatemyprofile
") ?>" /></td
>
397 <input type
="hidden" name
="course" value
="<?php p($course->id) ?>" />
398 <input type
="hidden" name
="id" value
="<?php p($user->id) ?>" />