92 lines
3.2 KiB
PHP
92 lines
3.2 KiB
PHP
<?php
|
|
require_once("include/globals.php");
|
|
|
|
?>
|
|
<br>
|
|
<form id='reset-form' method='post' action='/reset-password.php'>
|
|
<?php
|
|
$message_width = 400;
|
|
include "form.messages.php";
|
|
?>
|
|
<table width='400' cellpadding='2' cellspacing='2' border='0' class='content-table' align='center'>
|
|
<tr>
|
|
<td colspan='2' class='heading' align='center'><?php displayLanguageText('TEXT-CHANGE-PASSWORD'); ?></td>
|
|
</tr>
|
|
<tr>
|
|
<td colspan='2' align='left'><h2><?php displayLanguageText('TEXT-ENTER-NEW-PASSWORD'); ?></h2></td>
|
|
</tr>
|
|
<tr>
|
|
<td align='right'><?php displayLanguageText('TEXT-NAME'); ?>:</td>
|
|
<td><b><?php echo($name) ?></b></td>
|
|
</tr>
|
|
<tr>
|
|
<td align='right'><?php displayLanguageText('TEXT-USER-ID'); ?>:</td>
|
|
<td><b><?php echo($userid) ?></b></td>
|
|
</tr>
|
|
<tr>
|
|
<td align='right' valign='top'><?php displayLanguageText('TEXT-ENTER-NEW-PASSWORD'); ?>: </td>
|
|
<td align='left' valign='top'><input type='password' name='password1' id='password1' autocomplete='off' size='20'></td>
|
|
</tr>
|
|
<tr>
|
|
<td align='right' valign='top'><?php displayLanguageText('TEXT-REENTER-NEW-PASSWORD'); ?>: </td>
|
|
<td align='left' valign='top'><input type='password' name='password2' id='password2' autocomplete='off' size='20'></td>
|
|
</tr>
|
|
<tr>
|
|
<td colspan='3' align='center'>
|
|
<br>
|
|
<input type='submit' id='submitBtn' class='btn btn--primary' value="<?php displayLanguageText('BUTTON-UPDATE-PASSWORD'); ?>">
|
|
<input type='hidden' id='naction' name='naction' value='update'>
|
|
<input type='hidden' id='id' name='id' value='<?php echo($id) ?>'>
|
|
<input type='hidden' id='rn' name='rn' value='<?php echo($rn) ?>'>
|
|
<input type='hidden' id='tm' name='tm' value='<?php echo($tm) ?>'>
|
|
<input type='hidden' id='at' name='at' value='<?php echo($at) ?>'>
|
|
<br>
|
|
<br>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</form>
|
|
|
|
<script>
|
|
$(document).ready(function() {
|
|
$("#password1").focus();
|
|
|
|
$("#password2").change(function() {
|
|
checkPasswords();
|
|
});
|
|
|
|
function checkPasswords() {
|
|
var password1 = $("#password1").val();
|
|
var password2 = $("#password2").val();
|
|
var error_msg;
|
|
|
|
if (password1.length == 0 || password2.length == 0) {
|
|
error_msg = "<?php displayLanguageText('ERRORMSG-NO-PASSWORD-ENTERED'); ?>";
|
|
alert(error_msg);
|
|
return false;
|
|
}
|
|
|
|
if (password1.length && password2.length) {
|
|
if (password1 != password2) {
|
|
error_msg = "<?php displayLanguageText('ERRORMSG-PASSWORDS-DO-NOT-MATCH'); ?>";
|
|
alert(error_msg);
|
|
$("#password1").val('');
|
|
$("#password2").val('');
|
|
$("#password1").focus();
|
|
return false;
|
|
}
|
|
}
|
|
|
|
return true;
|
|
}
|
|
|
|
$("#submitBtn").click(function(e) {
|
|
e.preventDefault();
|
|
if (!checkPasswords()) return false;
|
|
$("#reset-form").submit();
|
|
});
|
|
|
|
});
|
|
</script>
|
|
|