CorePasswordValidator extends AbstractPasswordValidator

Configurable TYPO3 core password validator which can validate, that a password has:

  • A minimum length
  • At least one upper case char
  • At least one lower case char
  • At least one digit
  • At least one special char
Internal

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

Table of Contents

Properties

$options  : array

Methods

__construct()  : mixed
getErrorMessages()  : array
Returns all error messages
getRequirements()  : array
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

Properties

Methods

__construct()

public __construct([array $options = [] ]) : mixed
Parameters
$options : array = []

getErrorMessages()

Returns all error messages

public final getErrorMessages() : array
Return values
array

getRequirements()

Returns all requirements

public final getRequirements() : array
Return values
array

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

On this page

Search results