jenkins-bot has submitted this change and it was merged.
Change subject: New hook, UserRequiresHTTPS
......................................................................
New hook, UserRequiresHTTPS
Intended for situations where current user can't technically access the
site over a secure connection, e.g. due to a terribly obsolete browser or
WP Zero carrier that provides only insecure free access to the site.
Change-Id: I343985092c49a21fa347ca4dc0e5ec27774ad11d
---
M docs/hooks.txt
M includes/User.php
2 files changed, 9 insertions(+), 1 deletion(-)
Approvals:
Demon: Looks good to me, approved
jenkins-bot: Verified
diff --git a/docs/hooks.txt b/docs/hooks.txt
index 9d3da1c..e776d4c 100644
--- a/docs/hooks.txt
+++ b/docs/hooks.txt
@@ -2675,6 +2675,12 @@
$add : Array of strings corresponding to groups added
$remove: Array of strings corresponding to groups removed
+'UserRequiresHTTPS': Called to determine whether a user needs
+to be switched to HTTPS.
+$user: User in question.
+&$https: Boolean whether $user should be switched to HTTPS.
+
+
'UserRetrieveNewTalks': Called when retrieving "You have new messages!"
message(s).
$user: user retrieving new talks messages
diff --git a/includes/User.php b/includes/User.php
index 5573bd8..f200a47 100644
--- a/includes/User.php
+++ b/includes/User.php
@@ -2607,7 +2607,9 @@
if ( !$wgSecureLogin ) {
return false;
} else {
- return $this->getBoolOption( 'prefershttps' );
+ $https = $this->getBoolOption( 'prefershttps' );
+ wfRunHooks( 'UserRequiresHTTPS', array( $this, &$https
) );
+ return $https;
}
}
--
To view, visit https://gerrit.wikimedia.org/r/80038
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I343985092c49a21fa347ca4dc0e5ec27774ad11d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.22wmf13
Gerrit-Owner: Demon <[email protected]>
Gerrit-Reviewer: Demon <[email protected]>
Gerrit-Reviewer: MaxSem <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits