|
MediaWiki master
|
Check if a user's password complies with any password policies that apply to that user, based on the user's group membership. More...
Public Member Functions | |
| __construct (array $policies, array $checks) | |
| checkUserPassword (UserIdentity $user, string $password) | |
| Check if a password meets the effective password policy for a User. | |
| checkUserPasswordForGroups (UserIdentity $user, string $password, array $groups) | |
| Check if a password meets the effective password policy for a User, using a set of groups they may or may not belong to. | |
| getPoliciesForUser (UserIdentity $user) | |
| Get the policy for a user, based on their group membership. | |
Static Public Member Functions | |
| static | getPoliciesForGroups (array $policies, array $userGroups, array $defaultPolicy) |
| Utility function to get the effective policy from a list of policies, based on a list of groups. | |
| static | maxOfPolicies (array $p1, array $p2) |
| Utility function to get a policy that is the most restrictive of $p1 and $p2. | |
Check if a user's password complies with any password policies that apply to that user, based on the user's group membership.
Definition at line 26 of file UserPasswordPolicy.php.
| MediaWiki\Password\UserPasswordPolicy::__construct | ( | array | $policies, |
| array | $checks ) |
| array[] | $policies | List of policies per user group |
| callable[] | $checks | mapping statement to its checking function. Checking functions are called with the policy value for this user, the user object, and the password to check. |
Definition at line 46 of file UserPasswordPolicy.php.
| MediaWiki\Password\UserPasswordPolicy::checkUserPassword | ( | UserIdentity | $user, |
| string | $password ) |
Check if a password meets the effective password policy for a User.
| UserIdentity | $user | whose policy we are checking |
| string | $password | the password to check |
Definition at line 74 of file UserPasswordPolicy.php.
| MediaWiki\Password\UserPasswordPolicy::checkUserPasswordForGroups | ( | UserIdentity | $user, |
| string | $password, | ||
| array | $groups ) |
Check if a password meets the effective password policy for a User, using a set of groups they may or may not belong to.
This function does not use the DB, so can be used in the installer.
| UserIdentity | $user | whose policy we are checking |
| string | $password | the password to check |
| string[] | $groups | list of groups to which we assume the user belongs |
Definition at line 97 of file UserPasswordPolicy.php.
|
static |
Utility function to get the effective policy from a list of policies, based on a list of groups.
| array[] | $policies | List of policies per user group |
| string[] | $userGroups | the groups from which we calculate the effective policy |
| array | $defaultPolicy | the default policy to start from |
Definition at line 202 of file UserPasswordPolicy.php.
| MediaWiki\Password\UserPasswordPolicy::getPoliciesForUser | ( | UserIdentity | $user | ) |
Get the policy for a user, based on their group membership.
Public so UI elements can access and inform the user.
| UserIdentity | $user |
Definition at line 178 of file UserPasswordPolicy.php.
|
static |
Utility function to get a policy that is the most restrictive of $p1 and $p2.
For simplicity, we setup the policy values so the maximum value is always more restrictive. It is also used recursively to merge settings within the same policy.
| array | $p1 | |
| array | $p2 |
Definition at line 226 of file UserPasswordPolicy.php.