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": "MyExtensionHooks::onUserIsLocked"
	}
}
Called from:File(s): User.php
Interface:UserIsLockedHook.php

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

DetailsEdit

  • $user: User in question.
  • &$locked: Set true if the user should be locked.

NotesEdit

Added in MediaWiki 1.26 as part of the upcoming AuthManager system. Replaces the AuthPluginUser::isLocked() method call.

See alsoEdit