Manual:Hooks/UserIsLocked

From MediaWiki.org
Jump to navigation Jump to search
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"
	}
}

For MediaWiki ≤1.25:

$wgHooks['UserIsLocked'][] = 'MyExtensionHooks::onUserIsLocked';
Called from:File(s): User.php

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

Details[edit]

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

Notes[edit]

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

See also[edit]