Browse Source

Require confirmation when changing password

Resolves #227.
sqlitefix
Trevor Slocum 1 year ago
parent
commit
d300d9b2f2
  1. 4
      imgboard.php
  2. 7
      inc/html.php

4
imgboard.php

@ -1162,9 +1162,11 @@ EOF;
fancyDie(__('This account may not be updated while TINYIB_MODPASS is set.'));
}
if (isset($_POST['password'])) {
if (isset($_POST['password']) && isset($_POST['confirm'])) {
if ($_POST['password'] == '') {
fancyDie(__('A password is required.'));
} else if ($_POST['password'] != $_POST['confirm']) {
fancyDie(__('Passwords do not match.'));
}
$account['password'] = $_POST['password'];

7
inc/html.php

@ -1112,8 +1112,11 @@ function manageChangePasswordForm() {
<form id="tinyib" name="tinyib" method="post" action="?manage&changepassword">
<fieldset>
<legend>$txt_header</legend>
<input type="password" name="password" id="password" value="">
<input type="submit" value="$txt_submit" class="managebutton">
<table border="0">
<tr><td>New password</td><td><input type="password" name="password" id="password" value=""></td></tr>
<tr><td>Confirm</td><td><input type="password" name="confirm" id="confirm" value=""></td></tr>
<tr><td>&nbsp;</td><td><input type="submit" value="$txt_submit" class="managebutton"></td></tr>
</table>
<legend>
</fieldset>
</form><br>

Loading…
Cancel
Save