MediaWiki REL1_31
|
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. | |
static | checkMinimalPasswordLength ( $policyVal, User $user, $password) |
Check password is longer than minimum, not fatal. | |
static | checkMinimumPasswordLengthToLogin ( $policyVal, User $user, $password) |
Check password is longer than minimum, fatal. | |
static | checkPasswordCannotMatchBlacklist ( $policyVal, User $user, $password) |
Check if username and password are on a blacklist. | |
static | checkPasswordCannotMatchUsername ( $policyVal, User $user, $password) |
Check if username and password match. | |
static | checkPopularPasswordBlacklist ( $policyVal, User $user, $password) |
Ensure that password isn't in top X most popular passwords. | |
Functions to check passwords against a policy requirement.
Definition at line 29 of file PasswordPolicyChecks.php.
|
static |
Check password is shorter than maximum, fatal.
int | $policyVal | maximum length |
User | $user | |
string | $password |
Definition at line 70 of file PasswordPolicyChecks.php.
Referenced by PasswordPolicyChecksTest\testCheckMaximalPasswordLength().
|
static |
Check password is longer than minimum, not fatal.
int | $policyVal | minimal length |
User | $user | |
string | $password |
Definition at line 38 of file PasswordPolicyChecks.php.
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 55 of file PasswordPolicyChecks.php.
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 102 of file PasswordPolicyChecks.php.
References $username.
Referenced by PasswordPolicyChecksTest\testCheckPasswordCannotMatchBlacklist().
|
static |
Check if username and password match.
bool | $policyVal | true to force compliance. |
User | $user | |
string | $password |
Definition at line 85 of file PasswordPolicyChecks.php.
References $username, and $wgContLang.
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 134 of file PasswordPolicyChecks.php.
References $res, $wgPopularPasswordFile, and $wgSitename.
Referenced by PasswordPolicyChecksTest\testCheckPopularPasswordBlacklist().