Manual:Hooks/UserIsLocked
From Linux Web Expert
UserIsLocked | |
---|---|
<translate> Available from <tvar name=1><translate> version <tvar </tvar></translate> Check if the user is locked. See User::isLocked(). | |
<translate> Define function:</translate> | public static function onUserIsLocked( $user, &$locked ) { ... }
|
<translate> Attach hook:</translate> | <translate> In <tvar name=1>extension.json</tvar>:</translate>
{
"Hooks": {
"UserIsLocked": "MediaWiki\\Extension\\MyExtension\\Hooks::onUserIsLocked"
}
}
|
<translate> Called from:</translate> | <translate> File(s):</translate> user/User.php <translate> Function(s):</translate> isLocked |
<translate> Interface:</translate> | UserIsLockedHook.php |
<translate> For more information about attaching hooks, see <tvar name=1>Manual:Hooks </tvar>.</translate>
<translate> For examples of extensions using this hook, see <tvar name=cat>Category:UserIsLocked extensions</tvar>.</translate>
Notes
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
$user
: An instance ofUser
, representing the the user in question.&$locked
: A modifiablebool
representing whether the user is currently locked. Set this totrue
if the user should be locked.