Manual:Hooks/UserRequiresHTTPS

From Linux Web Expert

UserRequiresHTTPS
<translate> Available from <tvar name=1><translate> version <tvar (Gerrit change 80030)</tvar></translate>
<translate> Removed in <tvar name=1><translate> version <tvar (Gerrit change 675293)</tvar></translate>
Allows extensions to override whether users need to be redirected to HTTPS
<translate> Define function:</translate>
public static function onUserRequiresHTTPS( $user, &$https ) { ... }
<translate> Attach hook:</translate> <translate> In <tvar name=1>extension.json</tvar>:</translate>
{
	"Hooks": {
		"UserRequiresHTTPS": "MediaWiki\\Extension\\MyExtension\\Hooks::onUserRequiresHTTPS"
	}
}
<translate> Called from:</translate> <translate> File(s):</translate> user/User.php
<translate> Interface:</translate> UserRequiresHTTPSHook.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:UserRequiresHTTPS extensions</tvar>.</translate>


Details

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