Implement password expired, force the user to set a new password.

This commit is contained in:
dave 2010-07-15 09:17:59 +00:00
parent a403202786
commit dd6228f5d7
2 changed files with 12 additions and 6 deletions

View File

@ -547,7 +547,7 @@ function user_auth_required($all_required, $one_required = array())
/* Forward to password expired, remember the target URI */
if($_SESSION['password_expired'] == true) {
$_SESSION['request_uri'] = $_SERVER['REQUEST_URI'];
header("location: {$config['SFIABDIRECTORY']}/user_password.php");
header("location: {$config['SFIABDIRECTORY']}/user_account.php");
exit;
}

View File

@ -150,15 +150,15 @@ case 'save':
$a = account_load($accounts_id);
$d = '';
$email = $a['email'];
$username_link = ($a['link_username_to_email'] == 'yes') ? 'checked="checked"' : '';
$username = $email;
$ud = 'disabled="disabled"';
$_SESSION['password_expired'] = true;
if($_SESSION['password_expired'] == true) {
echo info(i18n('Your password has expired. You must choose a new password now.'));
echo notice(i18n('Your password has expired. You must choose a new password now.'));
$d = 'disabled="disabled"';
$validator_passreq = 'required: true,';
}
?>
@ -269,10 +269,12 @@ $().ready(function() {
minlength: 4
},
pass1: {
<?=$validator_passreq?>
minlength: 6,
maxlength: 32
},
pass2: {
<?=$validator_passreq?>
minlength: 6,
maxlength: 32,
equalTo: "#pass1"
@ -291,10 +293,12 @@ $().ready(function() {
checking: "Checking..."
},
pass1: {
required: "Please enter a password",
minlength: "Your password must be at least 6 characters long",
maxlength: "Your password must be at most 32 characters long"
},
pass2: {
required: "Please confirm the password",
minlength: "Your password must be at least 6 characters long",
maxlength: "Your password must be at most 32 characters long",
equalTo: "Please enter the same password as above"
@ -305,7 +309,8 @@ $().ready(function() {
}
});
/* Code to disable the username box */
<? if($_SESSION['password_expired'] == false) { ?>
/* Code to disable the username box, only included if the password hasn't expired */
var username_link = $("#username_link").is(":checked");
$("#username").attr("disabled", username_link);
$("#username_link").click(function() {
@ -313,12 +318,13 @@ $().ready(function() {
email_changed();
username_changed();
});
$("#email").change(email_changed);
$("#email").keyup(email_changed);
$("#username").change(username_changed);
$("#username").keyup(username_changed);
<? } ?>
});
</script>