PasswordPolicy
in package
FinalYes
Minimum password lengths: one source for the front forms and the Api checks.
IMPORTANT: the Api enforces USER_MIN_LENGTH only on flows where the visitor chooses a new
password (own password change, reset from the e-mailed link). The system rewrite
UserManager::updatePasswordForUser() (lazy rehash on
login, administration) stays without the check: an old 5-character password must keep
working, otherwise its owner could not sign in to change it.
Table of Contents
Constants
- ADMIN_MIN_LENGTH : int = 10
- Password typed in the admin user form, which also creates and changes accounts with admin access. Checked by the form only; existing shorter passwords keep working.
- ADVERT_MIN_LENGTH : int = 6
- Management password of an advert placed without an account (Bazaar, Comcat).
- USER_MIN_LENGTH : int = 8
- User account password (registration, change, reset).
Methods
- isLongEnough() : bool
Constants
ADMIN_MIN_LENGTH
Password typed in the admin user form, which also creates and changes accounts with admin access. Checked by the form only; existing shorter passwords keep working.
public
int
ADMIN_MIN_LENGTH
= 10
ADVERT_MIN_LENGTH
Management password of an advert placed without an account (Bazaar, Comcat).
public
int
ADVERT_MIN_LENGTH
= 6
USER_MIN_LENGTH
User account password (registration, change, reset).
public
int
USER_MIN_LENGTH
= 8
Methods
isLongEnough()
public
static isLongEnough(string $password, int $minLength) : bool
Parameters
- $password : string
- $minLength : int