-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Add minimum lowercase rule for password validation. #24230
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
wilsonge
merged 6 commits into
joomla:staging
from
HLeithner:add-lowercase-password-check
Mar 22, 2019
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
5523a23
Add minimum lowercase rule for password validation.
HLeithner df83f75
Do actual lowercase testing...
HLeithner ee1d90a
Use one word for lowercase and uppercase.
HLeithner da122f3
Use two words for lower case and upper case.
HLeithner e386929
Merge branch 'staging' into add-lowercase-password-check
jeckodevelopment 86b0867
Merge branch 'staging' into add-lowercase-password-check
jeckodevelopment File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -49,6 +49,7 @@ public function test(\SimpleXMLElement $element, $value, $group = null, Registry | |
| $minimumIntegers = isset($element['minimum_integers']) ? (int) $element['minimum_integers'] : 0; | ||
| $minimumSymbols = isset($element['minimum_symbols']) ? (int) $element['minimum_symbols'] : 0; | ||
| $minimumUppercase = isset($element['minimum_uppercase']) ? (int) $element['minimum_uppercase'] : 0; | ||
| $minimumLowercase = isset($element['minimum_lowercase']) ? (int) $element['minimum_lowercase'] : 0; | ||
|
|
||
| // If we have parameters from com_users, use those instead. | ||
| // Some of these may be empty for legacy reasons. | ||
|
|
@@ -60,13 +61,15 @@ public function test(\SimpleXMLElement $element, $value, $group = null, Registry | |
| $minimumIntegersp = $params->get('minimum_integers'); | ||
| $minimumSymbolsp = $params->get('minimum_symbols'); | ||
| $minimumUppercasep = $params->get('minimum_uppercase'); | ||
| $minimumLowercasep = $params->get('minimum_lowercase'); | ||
| $meterp = $params->get('meter'); | ||
| $thresholdp = $params->get('threshold'); | ||
|
|
||
| empty($minimumLengthp) ? : $minimumLength = (int) $minimumLengthp; | ||
| empty($minimumIntegersp) ? : $minimumIntegers = (int) $minimumIntegersp; | ||
| empty($minimumSymbolsp) ? : $minimumSymbols = (int) $minimumSymbolsp; | ||
| empty($minimumUppercasep) ? : $minimumUppercase = (int) $minimumUppercasep; | ||
| empty($minimumLowercasep) ? : $minimumLowercase = (int) $minimumLowercasep; | ||
| empty($meterp) ? : $meter = $meterp; | ||
| empty($thresholdp) ? : $threshold = $thresholdp; | ||
| } | ||
|
|
@@ -154,6 +157,22 @@ public function test(\SimpleXMLElement $element, $value, $group = null, Registry | |
| } | ||
| } | ||
|
|
||
| // Minimum number of lower case ASCII characters required | ||
| if (!empty($minimumLowercase)) | ||
| { | ||
| $nLowercase = preg_match_all('/[a-z]/', $value, $umatch); | ||
|
|
||
| if ($nLowercase < $minimumLowercase) | ||
| { | ||
| \JFactory::getApplication()->enqueueMessage( | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should be easy to namespace |
||
| \JText::plural('COM_USERS_MSG_NOT_ENOUGH_LOWERCASE_LETTERS_N', $minimumLowercase), | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. here too |
||
| 'warning' | ||
| ); | ||
|
|
||
| $validPassword = false; | ||
| } | ||
| } | ||
|
|
||
| // Minimum length option | ||
| if (!empty($minimumLength)) | ||
| { | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change here? Label too?