Aaron Schulz has submitted this change and it was merged.

Change subject: Add 2 new hooks to fix mobile logins
......................................................................


Add 2 new hooks to fix mobile logins

Bug 51789 is caused by loginwiki always redirecting back to desktop domain -
this patch gives MobileFrontend a chance to save the mobile host and then
redirect to it.

Corresponding MobileFrontend change: https://gerrit.wikimedia.org/r/75155

Change-Id: I3991ae4d90b3943e75cb2b869074094e56f2ccbf
---
M CentralAuthHooks.php
M specials/SpecialCentralLogin.php
2 files changed, 4 insertions(+), 3 deletions(-)

Approvals:
  Aaron Schulz: Verified; Looks good to me, approved



diff --git a/CentralAuthHooks.php b/CentralAuthHooks.php
index 1fb8463..62db3d2 100644
--- a/CentralAuthHooks.php
+++ b/CentralAuthHooks.php
@@ -437,6 +437,7 @@
                                'finalProto'    => $finalProto,
                                'currentProto'  => $request->detectProtocol()
                        );
+                       wfRunHooks( 'CentralAuthLoginRedirectData', array( 
$centralUser, &$data ) );
                        $wgMemc->set( $key, $data, 60 );
 
                        $wiki = WikiMap::getWiki( $wgCentralAuthLoginWiki );
diff --git a/specials/SpecialCentralLogin.php b/specials/SpecialCentralLogin.php
index 272018c..96501ce 100644
--- a/specials/SpecialCentralLogin.php
+++ b/specials/SpecialCentralLogin.php
@@ -109,9 +109,9 @@
                $url = $info['currentProto'] . ':' . $url;
 
                if ( $wgCentralAuthSilentLogin ) {
-                       $this->getOutput()->redirect( // expands to 
PROTO_CURRENT if $url doesn't have protocol
-                               wfAppendQuery( $url, array( 'token' => $token ) 
)
-                       );
+                       $url = wfAppendQuery( $url, array( 'token' => $token ) 
); // expands to PROTO_CURRENT if $url doesn't have protocol
+                       wfRunHooks( 'CentralAuthSilentLoginRedirect', array( 
$centralUser, &$url, $info ) );
+                       $this->getOutput()->redirect( $url );
                } else {
                        $this->getOutput()->addHtml(
                                Xml::openElement( 'form',

-- 
To view, visit https://gerrit.wikimedia.org/r/75154
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I3991ae4d90b3943e75cb2b869074094e56f2ccbf
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/CentralAuth
Gerrit-Branch: master
Gerrit-Owner: MaxSem <[email protected]>
Gerrit-Reviewer: Aaron Schulz <[email protected]>
Gerrit-Reviewer: Anomie <[email protected]>
Gerrit-Reviewer: CSteipp <[email protected]>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to