Manual:Hooks/UserRequiresHTTPS
From Linux Web Expert
File:OOjs UI icon alert-destructive.svg | <translate> This feature was removed completely in version <tvar name=ver>1.37.0</tvar> (after being deprecated in <tvar name=4>1.35.0</tvar>).</translate> |
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.