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

Methods

__construct()  : mixed
getRequirements()  : array
getValidationErrors()  : array
hasRequirements()  : bool
isEnabled()  : bool
isValidPassword()  : bool
Returns, if the given password meets all requirements defined by configured password policy validators.

Properties

$validationErrors

protected array $validationErrors = []

Methods

getRequirements()

public getRequirements() : array
Return values
array

getValidationErrors()

public getValidationErrors() : array
Return values
array

hasRequirements()

public hasRequirements() : bool
Return values
bool

isEnabled()

public isEnabled() : bool
Return values
bool

isValidPassword()

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).

Return values
bool
On this page

Search results