Several places in the password_policy.module make reference to the location of the password_policy_password_tab's password tab were not updated when that module was updated to place the password tab under the 'edit' path.

#1
Issue: Once your password has expired, you are not able to navigate to the password tab to make the change.
In password_policy_init(), line 34 needs to be changed from:

$change_password_url = 'user/'. $account->uid .'/'. (module_exists('password_policy_password_tab') ? 'password' : 'edit');

to:

$change_password_url = 'user/'. $account->uid .'/edit'. (module_exists('password_policy_password_tab') ? '/password' : '');

#2
In password_policy_user(), line 307 needs to be changed from:

drupal_goto('user/'. $account->uid .'/'. (module_exists('password_policy_password_tab') ? 'password' : 'edit'), $destination);

to:

drupal_goto('user/'. $account->uid .'/edit'. (module_exists('password_policy_password_tab') ? '/password' : ''), $destination);

#3
In password_policy_mail_tokens(), line 620 needs to be changed from:

'!edit_uri' => url('user/'. $account->uid .'/'. (module_exists('password_policy_password_tab') ? 'password' : 'edit'), array('absolute' => TRUE)),

to:

'!edit_uri' => url('user/'. $account->uid .'/edit'. (module_exists('password_policy_password_tab') ? '/password' : ''), array('absolute' => TRUE)),

Comments

draenen’s picture

Status: Active » Needs review
StatusFileSize
new2.12 KB

The attached patch makes the changes listed above.

ataxia’s picture

Immediately after installing and configuring this module, I was locked out and unable to change my password. I made these changes manually rather than installing the patch, and they worked great.

Thanks!

draenen’s picture

Did the patch fail?

technikh’s picture

Thanks for the patch. the patch worked for me.

patch -p0 < cannot-change-password-expired-1189756-2.patch
can't find file to patch at input line 5
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git a/password_policy.module b/password_policy.module
|index 54942ff..bc8e9eb 100644
|--- a/password_policy.module
|+++ b/password_policy.module
--------------------------
File to patch: password_policy.module
patching file password_policy.module
Crom’s picture

+1. Thanks.

erikwebb’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

phen’s picture

Needs to be ported to D7.

erikwebb’s picture

Version: 6.x-1.0 » 7.x-1.x-dev
Status: Closed (fixed) » Patch (to be ported)
erikwebb’s picture

Version: 7.x-1.x-dev » 6.x-1.x-dev
Status: Patch (to be ported) » Closed (fixed)

Actually, I don't think this needs to be ported to 7.x-1.x. The fix is contained in #1330502: Update password change tab to Drupal 7.

artkon’s picture

StatusFileSize
new717 bytes

I'm putting up another patch that targets version 1.5 for those who have only non-dev release versions of modules on their production servers.

Patch doesn't work with chgpwd module, use below

artkon’s picture

StatusFileSize
new756 bytes

Corrected patch for 1.5

erikwebb’s picture

@artkon - Those changes should be rolled into 6.x-1.5 at release (and not in any specific -dev release). What's the current problem?