Some of the policy settings are opaque to me. Please improve them to better reflect how the module actually works.

Steps:
1. Go to /admin/config/people/password_policy/add
2. Click Case sensitivity tab

Actual result:

Tab reads Case sensitive
Checkbox reads Case Sensitive
Password will require upper and lower case letters.

Expected result:

Tab reads Mixed case
Checkbox reads Mixed Case
Password will require upper and lower case letters.

Justification: Outside of the context of this module, "case sensitive" means that if the stored password has letters, the password entered at login time must match the stored password in case, but there is no implication that the stored password actually has a mix of upper and lower case. It is better for this module not to reuse the term "case sensitive" for a completely different concept.

3. Click Drupal strength tab

Actual result:
Password will be required to have match this level or higher. 0 - 100

Expected result something like:
Password will be required to have match this level or higher. 0 - 100

Starting from a base of 100 points:

  • Having only 3 out of 4 of uppercase, lowercase, digit, and symbol loses 12.5 points
  • Having only 2 out of 4 of uppercase, lowercase, digit, and symbol loses 25 points
  • Having only 1 out of 4 of uppercase, lowercase, digit, and symbol loses 40 points
  • Every character less than 6 loses 5 points
  • Username used as password without regard to case gets exactly 5 points

For example:

  • Aa1! is worth 100 - 10 = 90 points
  • ABCDefgh is worth 100 - 25 = 75 points
  • ABcd12#$ is worth 100 points
  • jsmith23 and JSmith23 are each worth 5 points for user jsmith23 but 75 or 87.5 points respectively for user rjones98

Justification: Allows administrator to set a sane value without having to look at the code, as well as possibly decide to impose other constraints such as minimum length.

Comments

aohrvetpv’s picture

Thanks for the suggested improvements--I, for one, am agreed on both "Mixed case" vs. "Case sensitive" and better explaining Drupal strength. If you provide a patch or patches, we can review/commit. Otherwise, I will try to create patches later.

charles belov’s picture

I'll try to create a patch.

charles belov’s picture

StatusFileSize
new2.37 KB

Here goes. I made some minor changes to the strength level description from above.

aohrvetpv’s picture

Status: Active » Needs review

Status: Needs review » Needs work

The last submitted patch, 3: improve_definitions-2402299-3.patch, failed testing.

aohrvetpv’s picture

The patch format seems to be a little off what the testbot expects. No worries, I can easily manually apply it and generate a new patch.

aohrvetpv’s picture

Version: 7.x-2.0-alpha3 » 7.x-2.x-dev
Status: Needs work » Needs review
StatusFileSize
new2.16 KB
aohrvetpv’s picture

Status: Needs review » Needs work

Drupal strength explanation omits 30-point penalty for <6 characters. Otherwise looks good.

charles belov’s picture

I've updated my local code. I'll upload a patch as soon as I figure out how to convert the line returns from Windows crlf to the required lf. git does this automatically for repository commits but apparently not for patch saves. This is my first patch submission ever.

aohrvetpv’s picture

You could install dos2unix then do:

git diff > foo.patch
dos2unix foo.patch

Or:

git diff | dos2unix > foo.patch

I don't see a git diff option to output with Unix line endings. You could probably configure git to both check out and commit Unix line endings, instead of checking out DOS and committing Unix, but if you are on Windows you may want to check out DOS. So using dos2unix may be the simplest way. This Drupal.org page also mentions dos2unix: https://www.drupal.org/node/707484

charles belov’s picture

StatusFileSize
new2.32 KB

Thank you. I also got some advice on the line feed issue at StackOverflow. I've tried implementing .gitattribute. We'll see how it goes.

aohrvetpv’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 11: improve_definitions-2402299-11.patch, failed testing.

aohrvetpv’s picture

The problem now is the paths, I think. They should be relative to the Password Policy root.

This procedure should produce correct paths:

git clone --branch 7.x-2.x http://git.drupal.org/project/password_policy.git
cd password_policy
Make changes.
git diff > foo.patch

Anyway, any patch you provide that fixes #8 I can apply manually, even if it does not satisfy the testbot.

charles belov’s picture

StatusFileSize
new2.22 KB

Hoping the 4th time is the charm.

charles belov’s picture

Status: Needs work » Needs review

aohrvetpv’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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