MediaWiki
1.32.5
|
Functions to check passwords against a policy requirement. More...
Static Public Member Functions | |
static | checkMaximalPasswordLength ( $policyVal, User $user, $password) |
Check password is shorter than maximum, fatal. More... | |
static | checkMinimalPasswordLength ( $policyVal, User $user, $password) |
Check password is longer than minimum, not fatal. More... | |
static | checkMinimumPasswordLengthToLogin ( $policyVal, User $user, $password) |
Check password is longer than minimum, fatal. More... | |
static | checkPasswordCannotMatchBlacklist ( $policyVal, User $user, $password) |
Check if username and password are on a blacklist. More... | |
static | checkPasswordCannotMatchUsername ( $policyVal, User $user, $password) |
Check if username and password match. More... | |
static | checkPopularPasswordBlacklist ( $policyVal, User $user, $password) |
Ensure that password isn't in top X most popular passwords. More... | |
Functions to check passwords against a policy requirement.
Definition at line 30 of file PasswordPolicyChecks.php.
|
static |
Check password is shorter than maximum, fatal.
int | $policyVal | maximum length |
User | $user | |
string | $password |
Definition at line 71 of file PasswordPolicyChecks.php.
References StatusValue\newGood().
Referenced by PasswordPolicyChecksTest\testCheckMaximalPasswordLength().
|
static |
Check password is longer than minimum, not fatal.
int | $policyVal | minimal length |
User | $user | |
string | $password |
Definition at line 39 of file PasswordPolicyChecks.php.
References StatusValue\newGood().
Referenced by PasswordPolicyChecksTest\testCheckMinimalPasswordLength().
|
static |
Check password is longer than minimum, fatal.
Intended for locking out users with passwords too short to trust, requiring them to recover their account by some other means.
int | $policyVal | minimal length |
User | $user | |
string | $password |
Definition at line 56 of file PasswordPolicyChecks.php.
References StatusValue\newGood().
Referenced by PasswordPolicyChecksTest\testCheckMinimumPasswordLengthToLogin().
|
static |
Check if username and password are on a blacklist.
bool | $policyVal | true to force compliance. |
User | $user | |
string | $password |
Definition at line 105 of file PasswordPolicyChecks.php.
References $user, $username, and StatusValue\newGood().
Referenced by PasswordPolicyChecksTest\testCheckPasswordCannotMatchBlacklist().
|
static |
Check if username and password match.
bool | $policyVal | true to force compliance. |
User | $user | |
string | $password |
Definition at line 86 of file PasswordPolicyChecks.php.
References $user, $username, and StatusValue\newGood().
Referenced by PasswordPolicyChecksTest\testCheckPasswordCannotMatchUsername().
|
static |
Ensure that password isn't in top X most popular passwords.
int | $policyVal | Cut off to use. Will automatically shrink to the max supported for error messages if set to more than max number of passwords on file, so you can use the PHP_INT_MAX constant here safely. |
User | $user | |
string | $password |
Definition at line 137 of file PasswordPolicyChecks.php.
References $res, $wgPopularPasswordFile, $wgSitename, Language\factory(), StatusValue\newGood(), and Makefile\open.
Referenced by PasswordPolicyChecksTest\testCheckPopularPasswordBlacklist().