Manual:Hooks/UserIsBlockedGlobally

From Linux Web Expert

Revision as of 16:57, 17 June 2022 by imported>Clump (Reverted edits by 180.243.14.173 (talk) to last version by Clump)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

UserIsBlockedGlobally
<translate> Available from <tvar name=1><translate> version <tvar </tvar></translate>
Runs before User::mBlockedGlobally is set; can be used to change the blocked status of an IP address or a user
<translate> Define function:</translate>
public static function onUserIsBlockedGlobally( &$user, $ip, &$blocked, &$block ) { ... }
<translate> Attach hook:</translate> <translate> In <tvar name=1>extension.json</tvar>:</translate>
{
	"Hooks": {
		"UserIsBlockedGlobally": "MediaWiki\\Extension\\MyExtension\\Hooks::onUserIsBlockedGlobally"
	}
}
<translate> Called from:</translate> <translate> File(s):</translate> User.php
<translate> Interface:</translate> UserIsBlockedGloballyHook.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:UserIsBlockedGlobally extensions</tvar>.</translate>

Details

  • &$user: User object
  • $ip: IP address of current user
  • &$blocked: blocked flag