2 if (!isset($user->htmleditor
)) {
5 if (empty($user->lang
)) {
6 $user->lang
= $CFG->lang
;
11 <form method=
"post" enctype=
"multipart/form-data" action=
"edit.php">
12 <table cellpadding=
9 cellspacing=
0 >
15 $theadmin = get_admin();
16 $adminself = (($theadmin->id
== $USER->id
) and ($USER->id
== $user->id
));
17 echo "<tr valign=top>";
18 echo "<td><p>".get_string("username").":</td>";
19 if ($adminself ||
is_internal_auth() ){
20 echo "<td><input type=\"text\" name=\"username\" size=20 value=\"";
23 if (isset($err["username"])) formerr($err["username"]);
27 echo "<input type=\"hidden\" name=\"username\" value=\"";
34 if ($adminself ||
is_internal_auth() ){
35 echo "<tr valign=top>";
36 echo "<td><p>".get_string("newpassword").":</td>";
37 echo "<td><input type=\"text\" name=\"newpassword\" size=20 value=\"";
38 if (isset($user->newpassword
)) p($user->newpassword
);
40 if (isset($err["newpassword"])) {
41 formerr($err["newpassword"]);
42 } else if (empty($user->newpassword
)) {
43 echo " (".get_string("leavetokeep").")";
47 echo "<tr><td colspan=2><HR></td></tr>";
52 <td><p><?php print_string("firstname") ?>:
</td>
53 <td><input type=
"text" name=
"firstname" size=
30 value=
"<?php p($user->firstname) ?>">
54 <?php
if (isset($err["firstname"])) formerr($err["firstname"]); ?>
58 <td><p><?php print_string("lastname") ?>:
</td>
59 <td><input type=
"text" name=
"lastname" size=
30 value=
"<?php p($user->lastname) ?>">
60 <?php
if (isset($err["lastname"])) formerr($err["lastname"]); ?>
64 <td><p><?php print_string("email") ?>:
</td>
65 <td><input type=
"text" name=
"email" size=
30 value=
"<?php p($user->email) ?>">
66 <?php
if (isset($err["email"])) formerr($err["email"]); ?>
70 <td><p><?php print_string("emaildisplay") ?>:
</td>
72 $choices["0"] = get_string("emaildisplayno");
73 $choices["1"] = get_string("emaildisplayyes");
74 $choices["2"] = get_string("emaildisplaycourse");
75 choose_from_menu ($choices, "maildisplay", $user->maildisplay
, "") ?>
79 <td><p><?php print_string("emailformat") ?>:
</td>
82 $choices["0"] = get_string("textformat");
83 $choices["1"] = get_string("htmlformat");
84 choose_from_menu ($choices, "mailformat", $user->mailformat
, "") ?>
88 <td><p><?php print_string("autosubscribe") ?>:
</td>
91 $choices["1"] = get_string("autosubscribeyes");
92 $choices["0"] = get_string("autosubscribeno");
93 choose_from_menu ($choices, "autosubscribe", $user->autosubscribe
, "") ?>
96 <?php if ($CFG->htmleditor
) { ?>
98 <td><p><?php print_string("textediting") ?>:
</td>
101 $choices["0"] = get_string("texteditor");
102 $choices["1"] = get_string("htmleditor");
103 choose_from_menu ($choices, "htmleditor", $user->htmleditor
, "") ?>
108 <td><p><?php print_string("city") ?>:
</td>
109 <td><input type=
"text" name=
"city" size=
25 value=
"<?php p($user->city) ?>">
110 <?php
if (isset($err["city"])) formerr($err["city"]); ?>
114 <td><p><?php print_string("country") ?>:
</td>
117 if (!$user->country
and $CFG->country
) {
118 $user->country
= $CFG->country
;
121 choose_from_menu (get_list_of_countries(), "country", $user->country
, get_string("selectacountry")."...", "", "") ?>
122 <?php if (isset($err["country"])) formerr($err["country"]); ?>
126 <td><p><?php print_string("preferredlanguage") ?>:
</td>
127 <td><?php if ($languages = get_list_of_languages()) {
129 $user->lang
= $CFG->lang
;
131 choose_from_menu ($languages, "lang", $user->lang
, "", "", "");
133 if (isset($err["lang"])) formerr($err["lang"]);
138 <td><p><?php print_string("timezone") ?>:
</td>
140 if (abs($user->timezone
) > 13) {
141 $user->timezone
= 99;
145 for ($tz = -26; $tz <= 26; $tz++
) {
146 $zone = (float)$tz/2.0;
147 $usertime = $timenow +
($tz * 1800);
149 $timezones["$zone"] = gmstrftime("%a, %I:%M %p", $usertime)." (GMT)";
150 } else if ($tz < 0) {
151 $timezones["$zone"] = gmstrftime("%a, %I:%M %p", $usertime)." (GMT$zone)";
153 $timezones["$zone"] = gmstrftime("%a, %I:%M %p", $usertime)." (GMT+$zone)";
157 choose_from_menu ($timezones, "timezone", $user->timezone
, get_string("serverlocaltime"), "", "99");
159 echo "(".get_string("currentlocaltime").")";
164 <td><p><?php print_string("userdescription") ?>:
</td>
165 <td><?php if (isset($err["description"])) {
166 formerr($err["description"]);
169 <textarea name=description cols=
50 rows=
10 wrap=virtual
><?php p($user->description
) ?></textarea>
170 <?php helpbutton("text", get_string("helptext")) ?>
174 <td colspan=
2><br /><b><?php print_string("followingoptional") ?>:
</b></td>
179 $maxbytes = get_max_upload_file_size($CFG->maxbytes
, $course->maxbytes
);
180 if (!empty($CFG->gdversion
) and $maxbytes) {
183 <td><p><?php print_string("newpicture") ?>:
</td>
185 <input type=
"hidden" name=
"MAX_FILE_SIZE" value=
"<?php echo $maxbytes ?>">
186 <input type
="file" name
="imagefile" size
=40>
187 <?php
helpbutton("picture", get_string("helppicture"));
188 print_string("maxsize", "", display_size($maxbytes));
189 if (isset($err["imagefile"])) formerr($err["imagefile"]);
196 <td><p><?php print_string("webpage") ?>:
</td>
197 <td><input type=
"text" name=
"url" size=
50 value=
"<?php p($user->url) ?>">
198 <?php
if (isset($err["url"])) formerr($err["url"]); ?>
202 <td><p><?php print_string("icqnumber") ?>:
</td>
203 <td><input type=
"text" name=
"icq" size=
25 value=
"<?php p($user->icq) ?>">
204 <?php
if (isset($err["icq"])) formerr($err["icq"]); ?>
208 <td><p><?php print_string("idnumber") ?>:
</td>
209 <td><input type=
"text" name=
"idnumber" size=
25 value=
"<?php p($user->idnumber) ?>"> <?php
p($teacheronly) ?>
210 <?php if (isset($err["idnumber"])) formerr($err["idnumber"]); ?>
214 <td><p><?php print_string("phone") ?> 1:
</td>
215 <td><input type=
"text" name=
"phone1" size=
25 value=
"<?php p($user->phone1) ?>"> <?php
p($teacheronly) ?>
216 <?php if (isset($err["phone1"])) formerr($err["phone1"]); ?>
220 <td><p><?php print_string("phone") ?> 2:
</td>
221 <td><input type=
"text" name=
"phone2" size=
25 value=
"<?php p($user->phone2) ?>"> <?php
p($teacheronly) ?>
222 <?php if (isset($err["phone2"])) formerr($err["phone2"]); ?>
226 <td><p><?php print_string("address") ?>:
</td>
227 <td><input type=
"text" name=
"address" size=
25 value=
"<?php p($user->address) ?>"> <?php
p($teacheronly) ?>
228 <?php if (isset($err["address"])) formerr($err["address"]); ?>
233 <td align=right
><input type=
"submit" value=
"<?php print_string("updatemyprofile
") ?>"></td
>
235 <input type
="hidden" name
="course" value
="<?php p($course->id) ?>">
236 <input type
="hidden" name
="id" value
="<?php p($user->id) ?>">