MaxSem has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/75680


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(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CentralAuth 
refs/changes/80/75680/1

diff --git a/CentralAuthHooks.php b/CentralAuthHooks.php
index 3e887f8..02079dc 100644
--- a/CentralAuthHooks.php
+++ b/CentralAuthHooks.php
@@ -455,6 +455,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 1e07951..dbf5996 100644
--- a/specials/SpecialCentralLogin.php
+++ b/specials/SpecialCentralLogin.php
@@ -110,9 +110,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/75680
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3991ae4d90b3943e75cb2b869074094e56f2ccbf
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CentralAuth
Gerrit-Branch: wmf/1.22wmf11
Gerrit-Owner: MaxSem <[email protected]>

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

Reply via email to