MediaWiki REL1_35
|
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 | checkPasswordCannotBeSubstringInUsername ( $policyVal, User $user, $password) |
Check if password is a (case-insensitive) substring within the username. | |
static | checkPasswordCannotMatchDefaults ( $policyVal, User $user, $password) |
Check if username and password are on a list of past MediaWiki default passwords. | |
static | checkPasswordCannotMatchUsername ( $policyVal, User $user, $password) |
Check if username and password are a (case-insensitive) match. | |
static | checkPasswordNotInCommonList ( $policyVal, User $user, $password) |
Ensure the password isn't in the list of common passwords by the wikimedia/common-passwords library, which contains (as of 0.2.0) the 100,000 top passwords from SecLists (as a Bloom filter, with an 0.000001 false positive ratio). | |
Functions to check passwords against a policy requirement.
$policyVal is the value configured in $wgPasswordPolicy. If the return status is fatal, the user won't be allowed to login. If the status is not good but not fatal, the user will not be allowed to set the given password (on registration or password change), but can still log in after bypassing a warning.
Definition at line 37 of file PasswordPolicyChecks.php.
|
static |
Check password is shorter than maximum, fatal.
Intended for preventing DoS attacks when using a more expensive password hash like PBKDF2.
int | $policyVal | maximum length |
User | $user | |
string | $password |
Definition at line 79 of file PasswordPolicyChecks.php.
|
static |
Check password is longer than minimum, not fatal.
int | $policyVal | minimal length |
User | $user | |
string | $password |
Definition at line 46 of file PasswordPolicyChecks.php.
|
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 63 of file PasswordPolicyChecks.php.
|
static |
Check if password is a (case-insensitive) substring within the username.
bool | $policyVal | true to force compliance. |
User | $user | |
string | $password |
Definition at line 113 of file PasswordPolicyChecks.php.
References User\getName().
|
static |
Check if username and password are on a list of past MediaWiki default passwords.
bool | $policyVal | true to force compliance. |
User | $user | |
string | $password |
Definition at line 133 of file PasswordPolicyChecks.php.
References User\getName().
|
static |
Check if username and password are a (case-insensitive) match.
bool | $policyVal | true to force compliance. |
User | $user | |
string | $password |
Definition at line 94 of file PasswordPolicyChecks.php.
References User\getName().
|
static |
Ensure the password isn't in the list of common passwords by the wikimedia/common-passwords library, which contains (as of 0.2.0) the 100,000 top passwords from SecLists (as a Bloom filter, with an 0.000001 false positive ratio).
bool | $policyVal | Whether to apply this policy |
User | $user | |
string | $password |
Definition at line 175 of file PasswordPolicyChecks.php.