Closed (fixed)
Project:
Password Policy
Version:
7.x-2.x-dev
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
19 Feb 2013 at 15:32 UTC
Updated:
1 Apr 2019 at 06:18 UTC
Jump to comment: Most recent
Comments
Comment #1
windmaomao commentedi tried to add a user, seems it's not currently enforced.
Comment #2
pbz1912 commentedI'm working on a patch.
Sponsored by British Council.
Comment #3
pbz1912 commentedI've run out of time to work on this. Sorry.
At first I thought it would be simple to implement with
password_policy_form_user_register_form_alter()However due to the way the validation is done for the user/$/edit page
$account = $form['#user'];It uses the user info that was there before the form was rendered. This could also cause issues if you were to have different password policies for different roles and change the role(s) at the same time as changing the password.
Then there is a lot of chasing around to work out whats actually using something from that array
$account, which after the best part of a day I still hadn't completely got through it.This is what I added to password_policy.module it obviously doesn't work but thought I'd put it here to help with the fixing of this.
Comment #4
Delphine Lepers commentedThe problem also occurs for the edit form if you add/remove a role to the user, the related policy is not enforced at save, but only the next time the password is changed.
IMO the policy should be checked for both cases NOT on the existing roles but on the checked roles (we expect new level(s) of security for a given new role(s) level(s)).
It is less of an issue on the edit form because users rarely modify their own role, but same logic should apply.
I will work on a patch.
Comment #5
coltraneThis was fixed with #2041717: Apply the password policy for anonymous users/user creation
Comment #7
artatum commentedHi
Currently on 7.x-1.9 and Drupal 7.34, when creating a new user, the pwd policy is not enforced at all. The module doesnt do what it's supposed to do at this time. It's supposed to be fixed one year ago, but not for me. :/
It's only the second time you edit the user password that the rules are enforced.
Any idea welcome.
Comment #8
aohrvetpv commentedartatum, when a policy applies to the "authenticated user" role it will also apply for user registration. This is because a newly created user has the "authenticated user" role. Check that your policy is enabled and the "authenticated user" role is selected.
Comment #9
coderider commentedagree with #8
this solve the issue Password policy not working on user create page