class Character_Constraint in Password Policy 5
Hierarchy
- class \Constraint
- class \Character_Constraint
Expanded class hierarchy of Character_Constraint
1 string reference to 'Character_Constraint'
File
- constraints/
constraint_character.php, line 5
View source
class Character_Constraint extends Constraint {
function validate($plaintext_password, $user = NULL) {
$len = strlen($plaintext_password);
$numValid = 0;
for ($i = 0; $i < $len; $i++) {
$numValid = $this
->_charIsValid($plaintext_password[$i]) ? $numValid + 1 : $numValid;
}
return $numValid >= $this->minimumConstraintValue;
}
function getDescription() {
return t('Password must contain the specified minimum number of characters.');
}
function getValidationErrorMessage() {
return t('Password must contain a minimum of %numChars %characters.', array(
'%numChars' => $this->minimumConstraintValue,
'%characters' => format_plural($this->minimumConstraintValue, t('character'), t('characters')),
));
}
function _charIsValid($character) {
return TRUE;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
Character_Constraint:: |
function |
Overrides Constraint:: |
6 | |
Character_Constraint:: |
function |
Overrides Constraint:: |
6 | |
Character_Constraint:: |
function |
Overrides Constraint:: |
2 | |
Character_Constraint:: |
function | 4 | ||
Constraint:: |
property | |||
Constraint:: |
property | |||
Constraint:: |
property | |||
Constraint:: |
function | |||
Constraint:: |
function | |||
Constraint:: |
function | |||
Constraint:: |
function | |||
Constraint:: |
function |