Support for Password Reset Landing Page (PRLP)

Created on 23 October 2014, over 9 years ago
Updated 15 April 2024, 2 months ago

Hi,

I am using the Password Reset Landing Page (PRLP) along with the password policy module.

The Password Reset Landing Page (PRLP) is a small module that basically makes users reset their passwords straight from the reset screen.

The password policy does not work with it but the changes that it would need to make it support it would be minor.

At this moment, because I don't really wanna change the Password Policy core module I am using hook_form_alter like this:

function mymodule_form_alter(&$form, $form_state, $form_id) {

global $user;

if (!in_array($form_id, array('user_pass_reset'))) {
return;
}
password_policy_password_element_alter($form['account']['pass'], $user);
$form['#validate'][] = 'password_policy_user_profile_form_validate';
$form['#submit'][] = 'password_policy_password_submit';
}

For Password Policy to support this module the changes would be basically:

1) Replace the $form['#user'] used in password_policy_form_alter to something like a global $user variable. This because the user is anonymous in password reset screen so that form variable isn't available, but the $user variable is.
2) Add the reset_form id to the in_array check being done in the beginning of password_policy_form_alter making it work on the reset pass form.

Will supply in next post a patch to the password policy module that would apply these changes.

Would be awesome to have this support in Password Policy module.

Thanks in advance and I hope this helps someone out!

✨ Feature request
Status

Needs review

Version

2.0

Component

Code

Created by

πŸ‡¦πŸ‡ΊAustralia kyuubi

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024