Manual:Hooks/UserRequiresHTTPS

From MediaWiki.org
Jump to navigation Jump to search
UserRequiresHTTPS
Available from version 1.22.0 (Gerrit change 80030)
Allows extensions to override whether users need to be redirected to HTTPS
Define function:
public static function onUserRequiresHTTPS( $user, &$https ) { ... }
Attach hook:

In extension.json:

{
	"Hooks": {
		"UserRequiresHTTPS": "MyExtensionHooks::onUserRequiresHTTPS"
	}
}
Called from:File(s): User.php
Interface:UserRequiresHTTPSHook.php

For more information about attaching hooks, see $1.
For examples of extensions using this hook, see Category:UserRequiresHTTPS extensions.