Closed (fixed)
Project:
Password Policy
Version:
7.x-1.x-dev
Component:
User interface
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
6 Dec 2016 at 15:38 UTC
Updated:
28 Jun 2017 at 21:45 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
aohrvetpv commentedLooks like a bug to me. When a user creates another user via admin/people/create, seems like either:
a. The password policies of the user creating a user should apply.
b. The password policies that apply to the initial roles of the created user should apply.
(b) seems more the proper solution to me, but (a) might be preferable to give administrators the ability to override password policies. Thoughts?
Comment #3
scotwith1tIf the check is added as a validation handler when the user edit form is submitted, it can check the roles that are given to the user on save and validate based on rules.
Comment #4
aohrvetpv commentedThis should perhaps be solved more generally by enforcing password policies for all account password elements, regardless of what form they are on:
#2562481: Apply password policies to account password elements on custom forms
Comment #5
aohrvetpv commentedThe patch in #2562481-19: Apply password policies to account password elements on custom forms will make it so the password policies of the current user are enforced when creating a new user.
Ideally the password policies that apply to the select roles would be applied. That would require changes to the password checking JavaScript as well as the PHP that checks the form submission against policies.
Comment #6
aohrvetpv commentedThis initial patch might work for applying policies to administrator-registered new users based on the roles they are assigned.
Needs more work to apply policies to administrator-edited existing users based on their roles.
I refactored
password_policy_password_validate()into many small functions to lessen my confusion working with the code.Comment #7
aohrvetpv commentedThis patch enforces policies that apply to the roles selected when an administrator registers a new user or edits an existing one.
Please review/test.
Comment #8
aohrvetpv commentedChanged logic so this new behavior will hopefully also apply to passwords on custom forms. For instance, if the Password Tab module is enabled and an administrator changes another user's password via the password tab, the roles of that user should be used for validating constraints.
Also fixed a minor bug with #7 and changed some wording.
Please review/test.
Comment #9
aohrvetpv commentedAdded test to #8.
Please give feedback. Will plan to commit soon.
Comment #10
aohrvetpv commentedMinor wording change in test added by #9.
Comment #11
aohrvetpv commenteddisregard, wrong issue
Comment #12
aohrvetpv commentedComment #14
aohrvetpv commented