PasswordPolicyValidator
Validates a password using validators configured in $GLOBALS['TYPO3_CONF_VARS']['SYS']['passwordPolicies'].
The class must be instantiated with an action (see PasswordPolicyAction) and a password policy name.
Table of Contents
Properties
- $passwordPolicy : PasswordPolicy|null
- $validationErrors : array<string|int, mixed>
Methods
- __construct() : mixed
- getRequirements() : array<string|int, mixed>
- getValidationErrors() : array<string|int, mixed>
- hasRequirements() : bool
- isEnabled() : bool
- isValidPassword() : bool
- Returns, if the given password meets all requirements defined by configured password policy validators.
Properties
$passwordPolicy
protected
PasswordPolicy|null
$passwordPolicy
= null
$validationErrors
protected
array<string|int, mixed>
$validationErrors
= []
Methods
__construct()
public
__construct(PasswordPolicyAction $action[, string $passwordPolicy = 'default' ]) : mixed
Parameters
- $action : PasswordPolicyAction
- $passwordPolicy : string = 'default'
getRequirements()
public
getRequirements() : array<string|int, mixed>
Return values
array<string|int, mixed>getValidationErrors()
public
getValidationErrors() : array<string|int, mixed>
Return values
array<string|int, mixed>hasRequirements()
public
hasRequirements() : bool
Return values
boolisEnabled()
public
isEnabled() : bool
Return values
boolisValidPassword()
Returns, if the given password meets all requirements defined by configured password policy validators.
public
isValidPassword(string $password[, ContextData|null $contextData = null ]) : bool
If no password policy is set or the password policy has no validators, the given password is considered as valid.
Parameters
- $password : string
-
The password to validate
- $contextData : ContextData|null = null
-
ContextData for usage in additional checks (e.g. password must not contain users firstname).