CSteipp has uploaded a new change for review.

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


Change subject: Allow extensions to change the SUL redirect
......................................................................

Allow extensions to change the SUL redirect

This may not be the best way to do it, but just a proposal to get the
conversation started.

This keeps things super simple, but it does mean an extension that
wants to redirect on things other than signup would need to have hooks
for both global users (and do the redirect with this hook) and non-
global users, and inject their content on the login success page.

Change-Id: I605cf01abb1838cd6dbd74314f282b256e8e17b8
---
M CentralAuthHooks.php
M specials/SpecialCentralLogin.php
2 files changed, 9 insertions(+), 1 deletion(-)


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

diff --git a/CentralAuthHooks.php b/CentralAuthHooks.php
index 2e40bfa..1fb8463 100644
--- a/CentralAuthHooks.php
+++ b/CentralAuthHooks.php
@@ -422,7 +422,8 @@
                                'returnTo'      => $returnTo,
                                'returnToQuery' => $returnToQuery,
                                'stickHTTPS'    => $request->getCheck( 
'wpStickHTTPS' ),
-                               'finalProto'    => $finalProto
+                               'finalProto'    => $finalProto,
+                               'type'          => $request->getText( 'type' )
                        );
 
                        // Create a new token to pass to 
Special:CentralLogin/start (central wiki)
diff --git a/specials/SpecialCentralLogin.php b/specials/SpecialCentralLogin.php
index 8fb04f3..ddc4379 100644
--- a/specials/SpecialCentralLogin.php
+++ b/specials/SpecialCentralLogin.php
@@ -204,6 +204,13 @@
                // which is needed or the personal links will be wrong.
                $this->getContext()->setUser( $user );
 
+               // Allow other extensions to modify the returnTo and 
returnToQuery
+               wfRunHooks( 'CentralAuthPostLoginRedirect', array(
+                               &$attempt['returnTo'],
+                               &$attempt['returnToQuery'],
+                               $attempt['type']
+               ) );
+
                if ( $wgCentralAuthSilentLogin ) {
                        // Mark the session to include the edge login imgs on 
the next pageview
                        $request->setSessionData( 'CentralAuthDoEdgeLogin', 
true );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I605cf01abb1838cd6dbd74314f282b256e8e17b8
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CentralAuth
Gerrit-Branch: master
Gerrit-Owner: CSteipp <[email protected]>

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

Reply via email to