NotCurrentPasswordValidator extends AbstractPasswordValidator

This validator checks, if the given password matches the current user password

Internal

only to be used within ext:core, not part of TYPO3 Core API.

Table of Contents

Properties

$options  : array<string|int, mixed>

Methods

__construct()  : mixed
getErrorMessages()  : array<string|int, mixed>
Returns all error messages
getRequirements()  : array<string|int, mixed>
Returns all requirements
initializeRequirements()  : void
Function must be overwritten by extending classes in order to add requirements.
validate()  : bool
Validates the given password. Function must be overwritten by extending classes.
addErrorMessage()  : void
Adds an validation error message with the given identifier and message.
addRequirement()  : void
Adds a requirement with the given identifier and message.
getLanguageService()  : LanguageService
isCurrentPassword()  : bool
Returns if the hash of the given password equals the hash of the current password

Properties

$options

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

Methods

__construct()

public __construct([array<string|int, mixed> $options = [] ]) : mixed
Parameters
$options : array<string|int, mixed> = []

getErrorMessages()

Returns all error messages

public final getErrorMessages() : array<string|int, mixed>
Return values
array<string|int, mixed>

getRequirements()

Returns all requirements

public final getRequirements() : array<string|int, mixed>
Return values
array<string|int, mixed>

initializeRequirements()

Function must be overwritten by extending classes in order to add requirements.

public initializeRequirements() : void

Use $this->addRequirement(string $identifier, string $message); to add a requirement.

validate()

Validates the given password. Function must be overwritten by extending classes.

public validate(string $password[, ContextData|null $contextData = null ]) : bool

If validation is considered as failed, use addErrorMessage(string $identifier, string $errorMessage) to add an error message and return false.

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

addErrorMessage()

Adds an validation error message with the given identifier and message.

protected final addErrorMessage(string $identifier, string $errorMessage) : void
Parameters
$identifier : string

Unique identifier for error message

$errorMessage : string

Message describing the error (e.g. "The password must at least contain one digit")

addRequirement()

Adds a requirement with the given identifier and message.

protected final addRequirement(string $identifier, string $message) : void
Parameters
$identifier : string

Unique identifier for requirement

$message : string

Message describing the requirement (e.g. "At least one digit")

isCurrentPassword()

Returns if the hash of the given password equals the hash of the current password

protected isCurrentPassword(string $password, ContextData $contextData) : bool
Parameters
$password : string
$contextData : ContextData
Return values
bool

        
On this page

Search results