We have users that forget their password, request a new one, then when they use the one-time login token, never actually reset their password once they're temporarily logged in. They need to be forced to change their password before they can browse the site.

Comments

deekayen’s picture

Assigned: Unassigned » Bastlynn
George Bills’s picture

+1 / subscribe.

jrz’s picture

subscribed

jrz’s picture

Back Again. I found a solution without touching the Password Policy Module.

function mymodule_form_user_pass_alter(&$form, &$form_state) {
$form['#submit'][] = 'mymodule_pass_submit';
}
function mymodule_pass_submit($form, &$form_state) {

$account = $form_state['values']['account'];

if(module_exists('password_policy')) {

db_query('UPDATE {password_policy_force_change} SET force_change = 1 WHERE uid = %d', $account->uid);

}
}

erikwebb’s picture

Status: Active » Closed (duplicate)
deekayen’s picture

Assigned: Bastlynn » Unassigned
Status: Closed (duplicate) » Active

The other was closed as un-solvable. If that's really the case, then let's patch core in a way that would allow this feature to happen. I think the request itself still has reasonable merit.

erikwebb’s picture

Version: 6.x-1.x-dev » 7.x-1.x-dev

Let's get this fixed for the more active 7.x branch and then we can patch backwards if the need exists.

erikwebb’s picture

Status: Active » Needs review
StatusFileSize
new2.5 KB

Since this changes core's behavior, I've added it as an option to the admin page to enable this behavior.

This somewhat depends on #1596960: Force password change on first-time login requires password to change

roball’s picture

Has anybody tried that patch?

Looking for the same functionality in 6.x-1.x.

deekayen’s picture

Version: 7.x-1.x-dev » 7.x-2.x-dev
Issue summary: View changes
Status: Needs review » Patch (to be ported)

  • deekayen committed bcfba4f on 8.x-1.x authored by erikwebb
    Issue #1051390 by erikwebb | deekayen: Added Make option for password...