Manual:Hooks/UserRequiresHTTPS

From mediawiki.org
UserRequiresHTTPS
Available from version 1.22.0 (Gerrit change 80030)
Removed in version 1.37.0 (Gerrit change 675293)
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": "MediaWiki\\Extension\\MyExtension\\Hooks::onUserRequiresHTTPS"
	}
}
Called from: File(s): user/User.php
Interface: UserRequiresHTTPSHook.php

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


Details[edit]

Allows extensions to override whether users need to be redirected to HTTPS, which is normally decided based on the prefershttps user preference. The value of that preference is passed in as the $https parameter for the hook to manipulate.

See also[edit]