4 $page_name = 'Reset User Password';
5 $level_restriction = ADMIN2
;
7 require 'encryption.inc.php';
9 if (isset ($_POST['submit']))
11 if ($_POST['new_pw'] != $_POST['confirm_pw'])
12 echo '<div class="alert">The new passwords do not match.</div>';
15 $user = mysql_fetch_row (mysql_query ('SELECT `regip`, `userid` FROM `users` WHERE
16 `username` = \''.mysql_real_escape_string ($_POST['username']).'\' LIMIT 1'));
18 echo '<div class="alert">THERE WAS AN ERROR FOR NO APPARENT REASON, PLZ DIE<br/>'.mysql_error().'</div>';
21 mysql_query ('UPDATE `users` SET `password` = \''.mysql_real_escape_string (encrypt ($_POST['new_pw'], $user[0])).'\' WHERE
22 `userid` = '.$user[1].' LIMIT 1');
23 stop ('Password successfully changed.');
29 <form method="post" action="'.urlpath(2).'">
30 <div class='.colour().'>
32 <input type="text" name="username"/><br/>
34 <input type="password" maxlength="40" size="40" name="new_pw"/><br/>
35 Confirm new password:<br/>
36 <input type="password" maxlength="40" size="40" name="confirm_pw"/><br/>
37 <input type="submit" name="submit" value="Change"/>