Aaron Schulz has submitted this change and it was merged.
Change subject: Allow extensions to change the SUL redirect
......................................................................
Allow extensions to change the SUL redirect
Allow extensions to redirect the user to another page after a CentralAuth
(SUL) login. Note that this does not redirect non-global users, since they
are not logged in with SUL.
Change-Id: I605cf01abb1838cd6dbd74314f282b256e8e17b8
---
M CentralAuthHooks.php
M specials/SpecialCentralLogin.php
2 files changed, 11 insertions(+), 1 deletion(-)
Approvals:
Aaron Schulz: Verified; Looks good to me, approved
jenkins-bot: Checked
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..272018c 100644
--- a/specials/SpecialCentralLogin.php
+++ b/specials/SpecialCentralLogin.php
@@ -210,6 +210,15 @@
// Show the login success page
$form = new LoginForm( new FauxRequest() );
+
+ // Allow other extensions to modify the returnTo and
returnToQuery
+ wfRunHooks( 'CentralAuthPostLoginRedirect', array(
+ &$attempt['returnTo'],
+ &$attempt['returnToQuery'],
+ $attempt['stickHTTPS'],
+ $attempt['type']
+ ) );
+
$form->showReturnToPage( 'successredirect',
$attempt['returnTo'],
$attempt['returnToQuery'], $attempt['stickHTTPS'] );
$this->getOutput()->setPageTitle( $this->msg(
'centralloginsuccesful' ) );
--
To view, visit https://gerrit.wikimedia.org/r/73449
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I605cf01abb1838cd6dbd74314f282b256e8e17b8
Gerrit-PatchSet: 6
Gerrit-Project: mediawiki/extensions/CentralAuth
Gerrit-Branch: master
Gerrit-Owner: CSteipp <[email protected]>
Gerrit-Reviewer: Aaron Schulz <[email protected]>
Gerrit-Reviewer: Anomie <[email protected]>
Gerrit-Reviewer: CSteipp <[email protected]>
Gerrit-Reviewer: Mattflaschen <[email protected]>
Gerrit-Reviewer: Spage <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits