Manual:Hooks/UserIsLocked

UserIsLocked
Available from version 1.26.0
Check if the user is locked. See User::isLocked().
Define function:
public static function onUserIsLocked( $user, &$locked ) { ... }
Attach hook: In extension.json:
{
	"Hooks": {
		"UserIsLocked": "MediaWiki\\Extension\\MyExtension\\Hooks::onUserIsLocked"
	}
}
Called from: File(s): user/User.php
Function(s): isLocked
Interface: UserIsLockedHook.php

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


Notes

edit

This hook was addded in MediaWiki 1.26 as part of the AuthManager system. This replaced the method call to AuthPluginUser::isLocked(), where the AuthPluginUser class was removed in MediaWiki 1.27 .

Parameters

edit
  • $user: An instance of User, representing the the user in question.
  • &$locked: A modifiable bool representing whether the user is currently locked. Set this to true if the user should be locked.

See also

edit