Manual:Hooks/PasswordPoliciesForUser

From MediaWiki.org
Jump to navigation Jump to search
PasswordPoliciesForUser
Available from version 1.26.0 (Gerrit change 206156)
Alter the effective password policy for a user.
Define function:
public static function onPasswordPoliciesForUser( $user, &$effectivePolicy ) { ... }
Attach hook:

In extension.json:

{
	"Hooks": {
		"PasswordPoliciesForUser": "MyExtensionHooks::onPasswordPoliciesForUser"
	}
}

For MediaWiki ≤1.25:

$wgHooks['PasswordPoliciesForUser'][] = 'MyExtensionHooks::onPasswordPoliciesForUser';
Called from: File(s): UserPasswordPolicy.php
Function(s): getPoliciesForUser

For more information about attaching hooks, see Manual:Hooks.
For examples of extensions using this hook, see Category:PasswordPoliciesForUser extensions.

Details[edit]

  • $user: User object whose policy you are modifying
  • &$effectivePolicy: Array of policy statements that apply to this user