Manual:Hooks/ResetPasswordExpiration

From MediaWiki.org
Jump to navigation Jump to search
ResetPasswordExpiration
Available from version 1.23.0 (Gerrit change 92037)
Allow extensions to set a default password expiration
Define function:
public static function onResetPasswordExpiration( User $user, &$newExpire ) { ... }
Attach hook:

In extension.json:

{
	"Hooks": {
		"ResetPasswordExpiration": "MyExtensionHooks::onResetPasswordExpiration"
	}
}

For MediaWiki ≤1.25:

$wgHooks['ResetPasswordExpiration'][] = 'MyExtensionHooks::onResetPasswordExpiration';
Called from:File(s): auth/AbstractPasswordPrimaryAuthenticationProvider.php
Function(s): getNewPasswordExpiry

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

Details[edit]

  • $user: The user having their password expiration reset
  • &$newExpire: The new expiration date. This is equal to either int, false, or null.