Closed (fixed)
Project:
Password Policy
Version:
7.x-1.2
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
10 May 2012 at 05:36 UTC
Updated:
9 Jun 2013 at 17:30 UTC
Jump to comment: Most recent file
Comments
Comment #1
erikwebb commentedIt seems like the requirement to enter the old password is actually coming from Drupal core. The expired passwords issue is Password Policy I'm sure, but I wonder what the connection is. Can you repeat the behavior without Password Policy and see what happens?
Comment #2
attheshow commentedI have the same issue as @jbsc97 above.
Comment #3
attheshow commentedTried upgrading to version 1.0 and the problem persists. FYI, the error message about the password being expired does not appear for the user in question when the Password Policy module is disabled.
Comment #4
attheshow commentedI was only able to correct the issue for the user by going into the "password_policy_expiration" database table and deleting the row that referred to the user id (uid) in question.
Looks like the error message is triggered by the "password_policy_init()" function, but I'm guessing it should be the responsibility of a different function to properly clear out the database record of the expiration once the password has been successfully changed by either an admin or the user himself/herself.
Comment #5
erikwebb commentedThis is the relevant code. Lines 286-298 in password_policy.module -
Comment #6
erikwebb commentedComment #7
attheshow commentedLooking at the code above... Could this problem be created then if the user changed the password to the same as the original password? That would cause the if statement above to return false and the record wouldn't be deleted.
Comment #8
erikwebb commentedI agree. In addition that seems like a scenario we should be catching and raising an error on. Would you mind checking to make sure this scenario is the cause of the problem?
Comment #9
erikwebb commentedComment #10
attheshow commentedConfirmed. This issue appears to happen if the following conditions are met:
The problem appears to be that the "password_policy_history" table is generally checked to make sure that a password is not being repeated. However, if the user does not initially have a historical password saved in that table, then the "if" statement shown in comment #5 above is never executed, the "password_policy_expiration" database table row for the user is not deleted during a password change, and the account becomes stuck as a permanently expired account.
Comment #11
attheshow commentedNote: It looks like the "Blocking expired accounts" setting must be initially set to "Expired accounts are blocked. Only administrators can unblock them." too.
Comment #12
erikwebb commentedI think all we need to check for is whether the user submitted a password with the account update. I've simplified the condition to account for this.
Comment #13
erikwebb commentedhttp://drupalcode.org/project/password_policy.git/commit/7b02bdb