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"
	}
}
Called from: File(s): auth/AbstractPasswordPrimaryAuthenticationProvider.php
Function(s): getNewPasswordExpiry
Interface: ResetPasswordExpirationHook.php

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.