Elgg
Version 5.0
|
Password generator service. More...
Public Member Functions | |
__construct (Config $config, Translator $translator, EventsService $events) | |
Constructor. More... | |
generatePassword (int $length=12) | |
Generate a new random password. More... | |
assertValidPassword (string $password) | |
Assert that a given string matches the password requirements. More... | |
isValidPassword (string $password) | |
Validate that a given string matches the password requirements. More... | |
getInputRegEx () | |
Get the regex to set on an input/password to validate password requirements during input. More... | |
getPasswordRequirementsDescription () | |
Get a description of how a valid password should be made. More... | |
addInputRequirements (\Elgg\Event $event) | |
Add the security password requirements to an input/password field. More... | |
registerUserPasswordValidation (\Elgg\Event $event) | |
Validate password during user registration. More... | |
Protected Member Functions | |
getGenerator () | |
Get helper generator. More... | |
getValidLength (int $length) | |
Make sure the password length requirement can be met by the password settings. More... | |
validatePasswordLength (string $password) | |
Validate that a password meets the minimal length requirement. More... | |
Protected Attributes | |
$config | |
$translator | |
$events | |
Password generator service.
Can generate and validate passwords based on config settings regarding password requirements
Definition at line 22 of file PasswordGeneratorService.php.
Elgg\Security\PasswordGeneratorService::__construct | ( | Config | $config, |
Translator | $translator, | ||
EventsService | $events | ||
) |
Constructor.
Config | $config | Elgg config |
Translator | $translator | Translator |
EventsService | $events | Events service |
Definition at line 46 of file PasswordGeneratorService.php.
Elgg\Security\PasswordGeneratorService::addInputRequirements | ( | \Elgg\Event | $event | ) |
Add the security password requirements to an input/password field.
\Elgg\Event | $event | 'view_vars', 'input/password' |
Definition at line 238 of file PasswordGeneratorService.php.
Elgg\Security\PasswordGeneratorService::assertValidPassword | ( | string | $password | ) |
Assert that a given string matches the password requirements.
string | $password | the password to validate |
InvalidPasswordLengthException | |
InvalidPasswordCharacterRequirementsException |
Definition at line 78 of file PasswordGeneratorService.php.
Elgg\Security\PasswordGeneratorService::generatePassword | ( | int | $length = 12 | ) |
Generate a new random password.
int | $length | the length of the password (can't be less the minimal password length config setting) |
Definition at line 59 of file PasswordGeneratorService.php.
|
protected |
Get helper generator.
Definition at line 283 of file PasswordGeneratorService.php.
Elgg\Security\PasswordGeneratorService::getInputRegEx | ( | ) |
Get the regex to set on an input/password to validate password requirements during input.
Note: This regex is meant for use in html/javascript NOT PHP
Definition at line 119 of file PasswordGeneratorService.php.
Elgg\Security\PasswordGeneratorService::getPasswordRequirementsDescription | ( | ) |
Get a description of how a valid password should be made.
Definition at line 183 of file PasswordGeneratorService.php.
|
protected |
Make sure the password length requirement can be met by the password settings.
int | $length | the requested length |
Definition at line 345 of file PasswordGeneratorService.php.
Elgg\Security\PasswordGeneratorService::isValidPassword | ( | string | $password | ) |
Validate that a given string matches the password requirements.
string | $password | the password to validate |
Definition at line 98 of file PasswordGeneratorService.php.
Elgg\Security\PasswordGeneratorService::registerUserPasswordValidation | ( | \Elgg\Event | $event | ) |
Validate password during user registration.
\Elgg\Event | $event | 'registeruser:validate:password', 'all' |
RegistrationException |
Definition at line 264 of file PasswordGeneratorService.php.
|
protected |
Validate that a password meets the minimal length requirement.
string | $password | the password to check |
Definition at line 363 of file PasswordGeneratorService.php.
|
protected |
Definition at line 27 of file PasswordGeneratorService.php.
|
protected |
Definition at line 37 of file PasswordGeneratorService.php.
|
protected |
Definition at line 32 of file PasswordGeneratorService.php.