jenkins-bot has submitted this change and it was merged.
Change subject: Deprecate $wgMFForceSecureLogin in favor of core setting
......................................................................
Deprecate $wgMFForceSecureLogin in favor of core setting
Change-Id: If2fd6ae42e58f6824d752b2e8b3b804ae99d450d
---
M MobileFrontend.php
M includes/MobileFrontend.hooks.php
M includes/skins/SkinMinerva.php
M includes/skins/SkinMobile.php
M includes/skins/UserLoginAndCreateTemplate.php
5 files changed, 12 insertions(+), 18 deletions(-)
Approvals:
Kaldari: Looks good to me, approved
jenkins-bot: Verified
diff --git a/MobileFrontend.php b/MobileFrontend.php
index f771648..eee421a 100644
--- a/MobileFrontend.php
+++ b/MobileFrontend.php
@@ -327,12 +327,6 @@
$wgDeviceDetectionClass = 'DeviceDetection';
/**
- * Will force login-related links to use https if set to true, otherwise
- * login-related links will use whatever protocol is in use by the user
- */
-$wgMFForceSecureLogin = false;
-
-/**
* Whether geodata related functionality should be enabled
*
* Defaults to false.
diff --git a/includes/MobileFrontend.hooks.php
b/includes/MobileFrontend.hooks.php
index e8d6b39..7dfb149 100644
--- a/includes/MobileFrontend.hooks.php
+++ b/includes/MobileFrontend.hooks.php
@@ -359,7 +359,7 @@
*
* We use this hook to ensure that login/account creation pages
* are redirected to HTTPS if they are not accessed via HTTPS and
- * $wgMFForceSecureLogin == true - but only when using the
+ * $wgSecureLogin == true - but only when using the
* mobile site.
*
* @param $special SpecialPage
@@ -367,7 +367,7 @@
* @return bool
*/
public static function onSpecialPageBeforeExecute( SpecialPage
$special, $subpage ) {
- global $wgMFForceSecureLogin;
+ global $wgSecureLogin;
$mobileContext = MobileContext::singleton();
$isMobileView = $mobileContext->shouldDisplayMobileView();
if ( $special->getName() != 'Userlogin' || !$isMobileView ) {
@@ -391,7 +391,7 @@
// most of this is lifted from https redirect code in
SpecialUserlogin::execute()
// also, checking for 'https' in $wgServer is a little funky,
but this is what
// is done on the WMF cluster (see config in CommonSettings.php)
- if ( $wgMFForceSecureLogin && WebRequest::detectProtocol() !=
'https' ) {
+ if ( $wgSecureLogin && WebRequest::detectProtocol() != 'https'
) {
// get the https url and redirect
$query =
$special->getContext()->getRequest()->getQueryValues();
if ( isset( $query['title'] ) ) {
diff --git a/includes/skins/SkinMinerva.php b/includes/skins/SkinMinerva.php
index 1cee3a5..e95b076 100644
--- a/includes/skins/SkinMinerva.php
+++ b/includes/skins/SkinMinerva.php
@@ -135,7 +135,7 @@
/**
* Prepares a url to the Special:UserLogin with query parameters,
- * taking into account $wgMFForceSecureLogin
+ * taking into account $wgSecureLogin
* @param array $query
* @return string
*/
@@ -148,7 +148,7 @@
* @return Array: Representation of button with text and href keys
*/
protected function getLogInOutLink() {
- global $wgMFForceSecureLogin;
+ global $wgSecureLogin;
wfProfileIn( __METHOD__ );
$query = array();
if ( !$this->getRequest()->wasPosted() ) {
@@ -168,7 +168,7 @@
$query[ 'returntoquery' ] = wfArrayToCgi(
$returntoquery );
}
$url = SpecialPage::getTitleFor( 'UserLogout'
)->getFullURL( $query );
- $url = $this->mobileContext->getMobileUrl( $url,
$wgMFForceSecureLogin );
+ $url = $this->mobileContext->getMobileUrl( $url,
$wgSecureLogin );
$text = wfMessage( 'mobile-frontend-main-menu-logout'
)->escaped();
} else {
// note returnto is not set for mobile (per product
spec)
diff --git a/includes/skins/SkinMobile.php b/includes/skins/SkinMobile.php
index c76ac27..0f0e184 100644
--- a/includes/skins/SkinMobile.php
+++ b/includes/skins/SkinMobile.php
@@ -378,16 +378,16 @@
/**
* Prepares a url to the Special:UserLogin with query parameters,
- * taking into account $wgMFForceSecureLogin
+ * taking into account $wgSecureLogin
* @param array $query
* @return string
*/
public function getLoginUrl( $query ) {
- global $wgMFForceSecureLogin;
+ global $wgSecureLogin;
- if ( WebRequest::detectProtocol() != 'https' &&
$wgMFForceSecureLogin ) {
+ if ( WebRequest::detectProtocol() != 'https' && $wgSecureLogin
) {
$loginUrl = SpecialPage::getTitleFor( 'Userlogin'
)->getFullURL( $query );
- return $this->mobileContext->getMobileUrl( $loginUrl,
$wgMFForceSecureLogin );
+ return $this->mobileContext->getMobileUrl( $loginUrl,
$wgSecureLogin );
}
return SpecialPage::getTitleFor( 'Userlogin' )->getLocalURL(
$query );
}
diff --git a/includes/skins/UserLoginAndCreateTemplate.php
b/includes/skins/UserLoginAndCreateTemplate.php
index 1ce2bc8..eacbbd5 100644
--- a/includes/skins/UserLoginAndCreateTemplate.php
+++ b/includes/skins/UserLoginAndCreateTemplate.php
@@ -62,9 +62,9 @@
* @return bool
*/
protected function doStickHTTPS() {
- global $wgMFForceSecureLogin;
+ global $wgSecureLogin;
$request = $this->getRequestContext()->getRequest();
- if ( $wgMFForceSecureLogin && $request->detectProtocol() ===
'https' ) {
+ if ( $wgSecureLogin && $request->detectProtocol() === 'https' )
{
return true;
}
return false;
--
To view, visit https://gerrit.wikimedia.org/r/80324
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: If2fd6ae42e58f6824d752b2e8b3b804ae99d450d
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: MaxSem <[email protected]>
Gerrit-Reviewer: Jdlrobson <[email protected]>
Gerrit-Reviewer: Kaldari <[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