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

$validationErrors

protected array<string|int, mixed> $validationErrors = []

Methods

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