Provides password strength validation according to server security requirements.
More...
List of all members.
Public Member Functions |
| __construct () |
| Initialize the message templates.
|
| isValid ($value) |
| Check if value is strong password according to server requirements for strong password.
|
Public Attributes |
const | WEAK_PASSWORD = 'weakPassword' |
Protected Member Functions |
| _containsLowercaseLetter ($value) |
| Return true if value contains at least one lowercase letter, otherwise return false.
|
| _containsNonAlphabetic ($value) |
| Return true if value contains at least one nonalphabetic character, otherwise return false.
|
| _containsUppercaseLetter ($value) |
| Return true if value contains at least one uppercase letter, otherwise return false.
|
Protected Attributes |
| $_messageTemplates = null |
Detailed Description
Provides password strength validation according to server security requirements.
- Copyright:
- 2011-2012 Perforce Software. All rights reserved
- License:
- Please see LICENSE.txt in top-level folder of this distribution.
- Version:
- 2012.2/486814
Constructor & Destructor Documentation
P4_Validate_StrongPassword::__construct |
( |
| ) |
|
Initialize the message templates.
{
$this->_messageTemplates = array(
self::WEAK_PASSWORD =>
"Passwords must be at least 8 characters long and contain "
. "mixed case or both alphabetic and non-alphabetic characters."
);
}
Member Function Documentation
P4_Validate_StrongPassword::_containsLowercaseLetter |
( |
$ |
value | ) |
[protected] |
Return true if value contains at least one lowercase letter, otherwise return false.
- Parameters:
-
- Returns:
- boolean
{
return preg_match("/[a-z]+/", $value);
}
P4_Validate_StrongPassword::_containsNonAlphabetic |
( |
$ |
value | ) |
[protected] |
Return true if value contains at least one nonalphabetic character, otherwise return false.
- Parameters:
-
- Returns:
- boolean
{
return preg_match("/[^a-zA-Z]+/", $value);
}
P4_Validate_StrongPassword::_containsUppercaseLetter |
( |
$ |
value | ) |
[protected] |
Return true if value contains at least one uppercase letter, otherwise return false.
- Parameters:
-
- Returns:
- boolean
{
return preg_match("/[A-Z]+/", $value);
}
P4_Validate_StrongPassword::isValid |
( |
$ |
value | ) |
|
Check if value is strong password according to server requirements for strong password.
- Parameters:
-
- Returns:
- boolean
Member Data Documentation
P4_Validate_StrongPassword::$_messageTemplates = null [protected] |
The documentation for this class was generated from the following file: