Incorrect variable name used for parameter.
[moodle-linuxchix.git] / user / edit.html
blobb698641b556b90d66389efe1a596eb3adad401bf
1 <?php
2 if (!isset($user->htmleditor)) {
3 $user->htmleditor = 1;
5 if (!isset($user->picture)) {
6 $user->picture = NULL;
8 if (empty($user->lang)) {
9 $user->lang = $CFG->lang;
11 if (!isset($user->theme)) {
12 $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">
22 <?php
23 if (isadmin()) {
24 $theadmin = get_admin();
25 $adminself = (($theadmin->id == $USER->id) and ($USER->id == $user->id));
26 echo '<tr>';
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=\"";
30 p($user->username);
31 echo "\" />";
32 if (isset($err["username"])) formerr($err["username"]);
33 } else {
34 echo "<td>";
35 p($user->username);
36 echo "<input type=\"hidden\" name=\"username\" value=\"";
37 p($user->username);
38 echo "\" />";
40 echo "</td>";
41 echo "</tr>\n";
43 $modules = get_list_of_plugins("auth");
44 foreach ($modules as $module) {
45 $auth_options[$module] = get_string("auth_$module"."title", "auth");
47 if (!$adminself) { /// Main admin is ALWAYS default manual
48 echo '<tr>';
49 echo '<th>'.get_string("chooseauthmethod","auth").':</th>' . "\n<td>";
50 choose_from_menu ($auth_options, 'auth', $user->auth);
51 helpbutton('authchange', get_string('chooseauthmethod', 'auth'));
52 echo "</td></tr>\n";
55 if ($adminself || is_internal_auth($user->auth) || (!empty($CFG->{'auth_'.$user->auth.'_stdchangepassword'}))) {
56 echo '<tr>';
57 echo '<th>'.get_string('newpassword').':</th>';
58 echo "<td><input type=\"text\" name=\"newpassword\" size=\"20\" alt=\"".get_string("newpassword")."\" value=\"";
59 if (isset($user->newpassword)) {
60 p($user->newpassword);
62 echo "\" />";
63 if (isset($err["newpassword"])) {
64 formerr($err["newpassword"]);
65 } else if (empty($user->newpassword)) {
66 echo " (".get_string("leavetokeep").")";
68 echo "</td>";
69 echo "</tr>\n";
70 if (!$adminself && (!empty($CFG->{'auth_'.$user->auth.'_stdchangepassword'}) || $CFG->changepassword)){
71 if (get_user_preferences('auth_forcepasswordchange', NULL, $user->id)) {
72 $checked = ' checked="checked" ';
73 } else {
74 $checked = '';
76 echo '<tr>';
77 echo '<th>'.get_string('forcepasswordchange').':</th>';
78 echo '<td><input type="checkbox" name="forcepasswordchange" alt="'.get_string('forcepasswordchange').'" '.$checked.' /> '.get_string('forcepasswordchangehelp').'</td>';
79 echo '</tr>';
82 echo '<tr><td colspan="2"><hr /></td></tr>';
87 <tr>
88 <th><?php print_string("firstname") ?>:</th>
89 <td>
90 <input type="text" name="firstname" size="30" alt="<?php print_string("firstname") ?>" maxlength="20" value="<?php p($user->firstname) ?>" />
91 <?php if (isset($err["firstname"])) formerr($err["firstname"]); ?>
92 </td>
93 </tr>
94 <tr>
95 <th><?php print_string("lastname") ?>:</th>
96 <td>
97 <input type="text" name="lastname" size="30" alt="<?php print_string("lastname") ?>" maxlength="20" value="<?php p($user->lastname) ?>" />
98 <?php if (isset($err["lastname"])) formerr($err["lastname"]); ?>
99 </td>
100 </tr>
101 <tr>
102 <th><?php print_string("email") ?>:</th>
103 <td>
104 <input type="text" name="email" size="30" alt="<?php print_string("email") ?>" maxlength="100" value="<?php p($user->email) ?>" />
105 <?php if (isset($err["email"])) formerr($err["email"]); ?>
106 </td>
107 </tr>
108 <tr>
109 <th><?php print_string("emaildisplay") ?>:</th>
110 <td><?php
111 unset($choices);
112 $choices["0"] = get_string("emaildisplayno");
113 $choices["1"] = get_string("emaildisplayyes");
114 $choices["2"] = get_string("emaildisplaycourse");
115 choose_from_menu ($choices, "maildisplay", $user->maildisplay, "") ?>
116 </td>
117 </tr>
118 <tr>
119 <th><?php print_string("emailactive") ?>:</th>
120 <td><?php
121 unset($choices);
122 $choices["0"] = get_string("emailenable");
123 $choices["1"] = get_string("emaildisable");
124 choose_from_menu ($choices, "emailstop", $user->emailstop, "") ?>
125 </td>
126 </tr>
127 <tr>
128 <th><?php print_string("emailformat") ?>:</th>
129 <td><?php
130 unset($choices);
131 $choices["0"] = get_string("textformat");
132 $choices["1"] = get_string("htmlformat");
133 choose_from_menu ($choices, "mailformat", $user->mailformat, "") ?>
134 </td>
135 </tr>
136 <tr>
137 <th><?php print_string('emaildigest') ?>:</th>
138 <td><?php
139 unset($choices);
140 $choices['0'] = get_string('emaildigestoff');
141 $choices['1'] = get_string('emaildigestcomplete');
142 $choices['2'] = get_string('emaildigestsubjects');
143 choose_from_menu ($choices, 'maildigest', $user->maildigest, "") ?>
144 </td>
145 </tr>
146 <tr>
147 <th><?php print_string("autosubscribe") ?>:</th>
148 <td><?php
149 unset($choices);
150 $choices["1"] = get_string("autosubscribeyes");
151 $choices["0"] = get_string("autosubscribeno");
152 choose_from_menu ($choices, "autosubscribe", $user->autosubscribe, "") ?>
153 </td>
154 </tr>
155 <?php if ($CFG->forum_trackreadposts) { ?>
156 <tr>
157 <th><?php print_string("trackforums") ?>:</th>
158 <td><?php
159 unset($choices);
160 $choices["0"] = get_string("trackforumsno");
161 $choices["1"] = get_string("trackforumsyes");
162 choose_from_menu ($choices, "trackforums", $user->trackforums, "") ?>
163 </td>
164 </tr>
165 <?php } ?>
166 <?php if ($CFG->htmleditor) { ?>
167 <tr>
168 <th><?php print_string("textediting") ?>:</th>
169 <td><?php
170 unset($choices);
171 $choices["0"] = get_string("texteditor");
172 $choices["1"] = get_string("htmleditor");
173 choose_from_menu ($choices, "htmleditor", $user->htmleditor, "") ?>
174 </td>
175 </tr>
176 <?php } ?>
177 <tr>
178 <th><?php print_string("city") ?>:</th>
179 <td>
180 <input type="text" name="city" size="25" alt="<?php print_string("city") ?>" maxlength="20" value="<?php p($user->city) ?>" />
181 <?php if (isset($err["city"])) formerr($err["city"]); ?>
182 </td>
183 </tr>
184 <tr>
185 <th><?php print_string("country") ?>:</th>
186 <td>
187 <?php
189 if (!$user->country and $CFG->country) {
190 $user->country = $CFG->country;
193 choose_from_menu(get_list_of_countries(), "country", $user->country, get_string("selectacountry")."...", "", "");
195 <?php if (isset($err["country"])) formerr($err["country"]); ?>
196 </td>
197 </tr>
198 <tr>
199 <th><?php print_string('timezone')?>:</th>
200 <td>
201 <?php
202 $timezones = get_list_of_timezones();
203 if ($CFG->forcetimezone != 99) {
204 choose_from_menu($timezones, 'timezone', $CFG->forcetimezone, get_string('serverlocaltime'), '', '99', false, true);
205 } else {
206 choose_from_menu($timezones, 'timezone', $user->timezone, get_string('serverlocaltime'), '', '99');
209 </td>
210 </tr>
211 <tr>
212 <th><?php print_string("preferredlanguage") ?>:</th>
213 <td><?php if ($languages = get_list_of_languages()) {
214 if (!$user->lang) {
215 $user->lang = $CFG->lang;
217 choose_from_menu ($languages, "lang", $user->lang, "", "", "");
219 if (isset($err["lang"])) formerr($err["lang"]);
221 </td>
222 </tr>
223 <?php if (!empty($CFG->allowuserthemes)) { ?>
224 <tr>
225 <th><?php print_string("preferredtheme") ?>:</th>
226 <td><?php
227 $themes[''] = get_string('default');
228 $themes += get_list_of_themes();
229 choose_from_menu($themes, 'theme', $user->theme, "", "", "");
230 if (isset($err["theme"])) formerr($err["theme"]);
232 </td>
233 </tr>
234 <?php } ?>
235 <tr>
236 <th><?php print_string("userdescription") ?>:</th>
237 <td><?php
238 if (isset($err["description"])) {
239 formerr($err["description"]);
240 echo "<br />";
242 print_textarea(false, 10, 50, 50, 10, 'description', "$user->description");
243 helpbutton("text", get_string("helptext"));
245 </td>
246 </tr>
247 <tr>
248 <td colspan="2" style="text-align: center;"><input type="submit" value="<?php print_string("updatemyprofile") ?>" /></td>
249 </tr>
252 <tr>
253 <td colspan="2" align="center"> <br /><b><?php print_string("followingoptional") ?>:</b></td>
254 </tr>
257 <?php
258 $maxbytes = get_max_upload_file_size($CFG->maxbytes, $course->maxbytes);
259 if (!empty($CFG->gdversion) and $maxbytes and empty($CFG->disableuserimages)) {
261 <tr>
262 <th><?php print_string("currentpicture") ?>:</th>
263 <td>
264 <?php print_user_picture($user->id, $course->id, $user->picture, false, false, false);
265 if ($user->picture) {
266 echo '&nbsp;&nbsp;<input type="checkbox" name="deletepicture" alt="'.get_string("delete").'" value="1" />';
267 print_string("delete");
270 </td>
271 </tr>
272 <tr>
273 <th><?php print_string("newpicture") ?>:</th>
274 <td>
275 <?php
276 require_once($CFG->dirroot.'/lib/uploadlib.php');
277 upload_print_form_fragment(1,array('imagefile'),null,false,null,0,0,false);
278 helpbutton("picture", get_string("helppicture"));
279 print_string("maxsize", "", display_size($maxbytes));
280 if (isset($err["imagefile"])) formerr($err["imagefile"]);
282 </td>
283 </tr>
284 <?php } else if (empty($CFG->gdversion) and isadmin()) { ?>
285 <tr>
286 <th><?php print_string("newpicture") ?>:</th>
287 <td>
288 <?php
289 echo "<a href=\"$CFG->wwwroot/$CFG->admin/config.php\">";
290 print_string('gdnot');
291 echo "</a>";
293 </td>
294 </tr>
295 <?php } ?>
297 <tr>
298 <th><?php print_string("webpage") ?>:</th>
299 <td><input type="text" name="url" size="50" alt="<?php print_string("webpage") ?>" maxlength="255" value="<?php p($user->url) ?>" />
300 <?php if (isset($err["url"])) formerr($err["url"]); ?>
301 </td>
302 </tr>
303 <tr>
304 <th><?php print_string("icqnumber") ?>:</th>
305 <td><input type="text" name="icq" size="25" alt="<?php print_string("icqnumber") ?>" maxlength="15" value="<?php p($user->icq) ?>" />
306 <?php if (isset($err["icq"])) formerr($err["icq"]); ?>
307 </td>
308 </tr>
309 <tr>
310 <th><?php print_string("skypeid") ?>:</th>
311 <td><input type="text" name="skype" size="25" alt="<?php print_string("skypeid") ?>" maxlength="50" value="<?php p($user->skype) ?>" />
312 <?php if (isset($err["skype"])) formerr($err["skype"]); ?>
313 </td>
314 </tr>
315 <tr>
316 <th><?php print_string("aimid") ?>:</th>
317 <td><input type="text" name="aim" size="25" alt="<?php print_string("aimid") ?>" maxlength="50" value="<?php p($user->aim) ?>" />
318 <?php if (isset($err["aim"])) formerr($err["aim"]); ?>
319 </td>
320 </tr>
321 <tr>
322 <th><?php print_string("yahooid") ?>:</th>
323 <td><input type="text" name="yahoo" size="25" alt="<?php print_string("yahooid") ?>" maxlength="50" value="<?php p($user->yahoo) ?>" />
324 <?php if (isset($err["yahoo"])) formerr($err["yahoo"]); ?>
325 </td>
326 </tr>
327 <tr>
328 <th><?php print_string("msnid") ?>:</th>
329 <td><input type="text" name="msn" size="25" alt="<?php print_string("msnid") ?>" maxlength="50" value="<?php p($user->msn) ?>" />
330 <?php if (isset($err["msn"])) formerr($err["msn"]); ?>
331 </td>
332 </tr>
333 <tr>
334 <th><?php print_string("idnumber") ?>:</th>
335 <td>
336 <input type="text" name="idnumber" size="25" alt="<?php print_string("idnumber") ?>" maxlength="12" value="<?php p($user->idnumber) ?>" /> <?php p($teacheronly) ?>
337 <?php if (isset($err["idnumber"])) formerr($err["idnumber"]); ?>
338 </td>
339 </tr>
340 <?php if (isadmin()) { ?>
341 <tr>
342 <th><?php print_string("institution") ?>:</th>
343 <td><input type="text" name="institution" size="25" alt="<?php print_string("institution") ?>" maxlength="40" value="<?php p($user->institution) ?>" /> <?php p($teacheronly) ?>
344 </td>
345 </tr>
346 <tr>
347 <th><?php print_string("department") ?>:</th>
348 <td>
349 <input type="text" name="department" size="25" alt="<?php print_string("department") ?>" maxlength="30" value="<?php p($user->department) ?>" /> <?php p($teacheronly) ?>
350 </td>
351 </tr>
352 <?php } ?>
353 <tr>
354 <th><?php print_string("phone") ?> 1:</th>
355 <td>
356 <input type="text" name="phone1" size="25" alt="<?php print_string("phone") ?>" maxlength="20" value="<?php p($user->phone1) ?>" /> <?php p($teacheronly) ?>
357 <?php if (isset($err["phone1"])) formerr($err["phone1"]); ?>
358 </td>
359 </tr>
360 <tr>
361 <th><?php print_string("phone") ?> 2:</th>
362 <td>
363 <input type="text" name="phone2" size="25" alt="<?php print_string("phone") ?>" maxlength="20" value="<?php p($user->phone2) ?>" /> <?php p($teacheronly) ?>
364 <?php if (isset($err["phone2"])) formerr($err["phone2"]); ?>
365 </td>
366 </tr>
367 <tr>
368 <th><?php print_string("address") ?>:</th>
369 <td>
370 <input type="text" name="address" size="25" alt="<?php print_string("address") ?>" maxlength="70" value="<?php p($user->address) ?>" /> <?php p($teacheronly) ?>
371 <?php if (isset($err["address"])) formerr($err["address"]); ?>
372 </td>
373 </tr>
374 <tr>
375 <td colspan="2" style="text-align: center;"><input type="submit" value="<?php print_string("updatemyprofile") ?>" /></td>
376 </tr>
377 </table>
378 <input type="hidden" name="course" value="<?php p($course->id) ?>" />
379 <input type="hidden" name="id" value="<?php p($user->id) ?>" />
380 </form>