migrated signup.php over to using new formslib
[moodle.git] / login / change_password_form.html
CommitLineData
03f5a0f8 1
2<?php
3 // only display this help message if we are being forced to change
4 if ($forcepassword) {
5 notify( get_string('forcepasswordchangenotice') );
6 }
7 ?>
8<p><b><?php print_string("allfieldsrequired") ?></b></p>
9<?php
10 if (empty($frm->username)) {
11 $frm->username = "";
12 }
13 if (empty($frm->password)) {
14 $frm->password = "";
15 }
16 if (empty($frm->newpassword1)) {
17 $frm->newpassword1 = "";
18 }
19 if (empty($frm->newpassword2)) {
20 $frm->newpassword2 = "";
21 }
22?>
23<form action="change_password.php" method="post" name="form" id="form">
24<table cellpadding="10">
25
26<tr valign="top">
27 <td><?php print_string("username") ?>:</td>
28 <td>
29 <?php if (has_capability('moodle/user:update',get_context_instance(CONTEXT_SYSTEM, SITEID)) || empty($frm->username)) { ?>
30 <input type="text" name="username" size="25" value="<?php p($frm->username) ?>" alt="<?php print_string("username") ?>" />
31 <?php } else { ?>
32 <input type="hidden" name="username" value="<?php p($frm->username)?>" /> <?php p($frm->username)?>
33 <?php } ?>
34 <?php if (!empty($err->username)) { formerr($err->username); } ?>
35 </td>
36</tr>
37
8b902ba4 38<?php if (!has_capability('moodle/user:update',get_context_instance(CONTEXT_SYSTEM, SITEID))) { ?>
03f5a0f8 39 <tr valign="top">
40 <td><?php print_string("oldpassword") ?>:</td>
41 <td><input type="password" name="password" size="25" value="<?php p($frm->password) ?>" alt="<?php print_string("password") ?>" />
42 <?php if (!empty($err->password)) { formerr($err->password); } ?>
43 </td>
44 </tr>
45<?php } ?>
46
47<tr valign="top">
48 <td><?php print_string("newpassword") ?>:</td>
49 <td><input type="password" name="newpassword1" size="25" value="<?php p($frm->newpassword1) ?>" alt="<?php print_string("newpassword") ?>" />
50 <?php if (!empty($err->newpassword1)) { formerr($err->newpassword1); } ?>
51 </td>
52</tr>
53<tr valign="top">
54 <td><?php print_string("newpassword") ?> (<?php print_string("again") ?>):</td>
55 <td><input type="password" name="newpassword2" size="25" value="<?php p($frm->newpassword2) ?>" alt="<?php print_string("newpassword") ?> (<?php print_string("again") ?>)" />
56 <?php if (!empty($err->newpassword2)) { formerr($err->newpassword2); } ?>
57 </td>
58</tr>
59<tr>
60 <td></td>
61 <td><input type="hidden" name="id" value="<?php p($frm->id)?>" />
62 <input type="submit" value="<?php print_string("changepassword") ?>" /></td>
63 </tr>
64 </table>
65</form>