2 if (!isset($user->htmleditor
)) {
5 if (!isset($user->picture
)) {
8 if (empty($user->lang
)) {
9 $user->lang
= $CFG->lang
;
14 <form method=
"post" enctype=
"multipart/form-data" action=
"edit.php">
15 <table cellpadding=
9 cellspacing=
0 >
18 $theadmin = get_admin();
19 $adminself = (($theadmin->id
== $USER->id
) and ($USER->id
== $user->id
));
20 echo "<tr valign=top>";
21 echo "<td><p>".get_string("username").":</td>";
22 if ($adminself ||
is_internal_auth() ){
23 echo "<td><input type=\"text\" name=\"username\" size=20 value=\"";
26 if (isset($err["username"])) formerr($err["username"]);
30 echo "<input type=\"hidden\" name=\"username\" value=\"";
37 if ($adminself ||
is_internal_auth() ){
38 echo "<tr valign=top>";
39 echo "<td><p>".get_string("newpassword").":</td>";
40 echo "<td><input type=\"text\" name=\"newpassword\" size=20 value=\"";
41 if (isset($user->newpassword
)) p($user->newpassword
);
43 if (isset($err["newpassword"])) {
44 formerr($err["newpassword"]);
45 } else if (empty($user->newpassword
)) {
46 echo " (".get_string("leavetokeep").")";
50 echo "<tr><td colspan=2><HR></td></tr>";
55 <td><p><?php print_string("firstname") ?>:
</td>
56 <td><input type=
"text" name=
"firstname" size=
30 value=
"<?php p($user->firstname) ?>">
57 <?php
if (isset($err["firstname"])) formerr($err["firstname"]); ?>
61 <td><p><?php print_string("lastname") ?>:
</td>
62 <td><input type=
"text" name=
"lastname" size=
30 value=
"<?php p($user->lastname) ?>">
63 <?php
if (isset($err["lastname"])) formerr($err["lastname"]); ?>
67 <td><p><?php print_string("email") ?>:
</td>
68 <td><input type=
"text" name=
"email" size=
30 value=
"<?php p($user->email) ?>">
69 <?php
if (isset($err["email"])) formerr($err["email"]); ?>
73 <td><p><?php print_string("emaildisplay") ?>:
</td>
75 $choices["0"] = get_string("emaildisplayno");
76 $choices["1"] = get_string("emaildisplayyes");
77 $choices["2"] = get_string("emaildisplaycourse");
78 choose_from_menu ($choices, "maildisplay", $user->maildisplay
, "") ?>
82 <td><p><?php print_string("emailformat") ?>:
</td>
85 $choices["0"] = get_string("textformat");
86 $choices["1"] = get_string("htmlformat");
87 choose_from_menu ($choices, "mailformat", $user->mailformat
, "") ?>
91 <td><p><?php print_string("autosubscribe") ?>:
</td>
94 $choices["1"] = get_string("autosubscribeyes");
95 $choices["0"] = get_string("autosubscribeno");
96 choose_from_menu ($choices, "autosubscribe", $user->autosubscribe
, "") ?>
99 <?php if ($CFG->htmleditor
) { ?>
101 <td><p><?php print_string("textediting") ?>:
</td>
104 $choices["0"] = get_string("texteditor");
105 $choices["1"] = get_string("htmleditor");
106 choose_from_menu ($choices, "htmleditor", $user->htmleditor
, "") ?>
111 <td><p><?php print_string("city") ?>:
</td>
112 <td><input type=
"text" name=
"city" size=
25 value=
"<?php p($user->city) ?>">
113 <?php
if (isset($err["city"])) formerr($err["city"]); ?>
117 <td><p><?php print_string("country") ?>:
</td>
120 if (!$user->country
and $CFG->country
) {
121 $user->country
= $CFG->country
;
124 choose_from_menu (get_list_of_countries(), "country", $user->country
, get_string("selectacountry")."...", "", "") ?>
125 <?php if (isset($err["country"])) formerr($err["country"]); ?>
129 <td><p><?php print_string("preferredlanguage") ?>:
</td>
130 <td><?php if ($languages = get_list_of_languages()) {
132 $user->lang
= $CFG->lang
;
134 choose_from_menu ($languages, "lang", $user->lang
, "", "", "");
136 if (isset($err["lang"])) formerr($err["lang"]);
141 <td><p><?php print_string("timezone") ?>:
</td>
143 if (abs($user->timezone
) > 13) {
144 $user->timezone
= 99;
148 for ($tz = -26; $tz <= 26; $tz++
) {
149 $zone = (float)$tz/2.0;
150 $usertime = $timenow +
($tz * 1800);
152 $timezones["$zone"] = gmstrftime("%a, %I:%M %p", $usertime)." (GMT)";
153 } else if ($tz < 0) {
154 $timezones["$zone"] = gmstrftime("%a, %I:%M %p", $usertime)." (GMT$zone)";
156 $timezones["$zone"] = gmstrftime("%a, %I:%M %p", $usertime)." (GMT+$zone)";
160 choose_from_menu ($timezones, "timezone", $user->timezone
, get_string("serverlocaltime"), "", "99");
162 echo "(".get_string("currentlocaltime").")";
167 <td><p><?php print_string("userdescription") ?>:
</td>
168 <td><?php if (isset($err["description"])) {
169 formerr($err["description"]);
172 <textarea name=description cols=
50 rows=
10 wrap=virtual
><?php p($user->description
) ?></textarea>
173 <?php helpbutton("text", get_string("helptext")) ?>
177 <td colspan=
2><br /><b><?php print_string("followingoptional") ?>:
</b>
178 <?php print_user_picture($user->id
, $course->id
, $user->picture
, false, false, false); ?>
184 $maxbytes = get_max_upload_file_size($CFG->maxbytes
, $course->maxbytes
);
185 if (!empty($CFG->gdversion
) and $maxbytes and empty($CFG->disableuserimages
)) {
188 <td><p><?php print_string("newpicture") ?>:
</td>
190 <input type=
"hidden" name=
"MAX_FILE_SIZE" value=
"<?php echo $maxbytes ?>">
191 <input type
="file" name
="imagefile" size
=40>
192 <?php
helpbutton("picture", get_string("helppicture"));
193 print_string("maxsize", "", display_size($maxbytes));
194 if (isset($err["imagefile"])) formerr($err["imagefile"]);
201 <td><p><?php print_string("webpage") ?>:
</td>
202 <td><input type=
"text" name=
"url" size=
50 value=
"<?php p($user->url) ?>">
203 <?php
if (isset($err["url"])) formerr($err["url"]); ?>
207 <td><p><?php print_string("icqnumber") ?>:
</td>
208 <td><input type=
"text" name=
"icq" size=
25 value=
"<?php p($user->icq) ?>">
209 <?php
if (isset($err["icq"])) formerr($err["icq"]); ?>
213 <td><p><?php print_string("idnumber") ?>:
</td>
214 <td><input type=
"text" name=
"idnumber" size=
25 value=
"<?php p($user->idnumber) ?>"> <?php
p($teacheronly) ?>
215 <?php if (isset($err["idnumber"])) formerr($err["idnumber"]); ?>
218 <?php if (isadmin()) { ?>
220 <td><p><?php print_string("institution") ?>:
</td>
221 <td><input type=
"text" name=
"institution" size=
25 value=
"<?php p($user->institution) ?>"> <?php
p($teacheronly) ?>
225 <td><p><?php print_string("department") ?>:
</td>
226 <td><input type=
"text" name=
"department" size=
25 value=
"<?php p($user->department) ?>"> <?php
p($teacheronly) ?>
231 <td><p><?php print_string("phone") ?> 1:
</td>
232 <td><input type=
"text" name=
"phone1" size=
25 value=
"<?php p($user->phone1) ?>"> <?php
p($teacheronly) ?>
233 <?php if (isset($err["phone1"])) formerr($err["phone1"]); ?>
237 <td><p><?php print_string("phone") ?> 2:
</td>
238 <td><input type=
"text" name=
"phone2" size=
25 value=
"<?php p($user->phone2) ?>"> <?php
p($teacheronly) ?>
239 <?php if (isset($err["phone2"])) formerr($err["phone2"]); ?>
243 <td><p><?php print_string("address") ?>:
</td>
244 <td><input type=
"text" name=
"address" size=
25 value=
"<?php p($user->address) ?>"> <?php
p($teacheronly) ?>
245 <?php if (isset($err["address"])) formerr($err["address"]); ?>
250 <td align=right
><input type=
"submit" value=
"<?php print_string("updatemyprofile
") ?>"></td
>
252 <input type
="hidden" name
="course" value
="<?php p($course->id) ?>">
253 <input type
="hidden" name
="id" value
="<?php p($user->id) ?>">