jenkins-bot has submitted this change and it was merged.

Change subject: Added a function to LoginForm to show the "return to" page.
......................................................................


Added a function to LoginForm to show the "return to" page.

* This can be used be extensions like CentralAuth.

Change-Id: Idd71cac47195402ebffeb7047e91efb200a32b58
---
M includes/specials/SpecialUserlogin.php
1 file changed, 23 insertions(+), 0 deletions(-)

Approvals:
  Anomie: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/specials/SpecialUserlogin.php 
b/includes/specials/SpecialUserlogin.php
index e0ddc96..3f18f95 100644
--- a/includes/specials/SpecialUserlogin.php
+++ b/includes/specials/SpecialUserlogin.php
@@ -975,6 +975,29 @@
 
        /**
         * Add a "return to" link or redirect to it.
+        * Extensions can use this to reuse the "return to" logic after
+        * inject steps (such as redirection) into the login process.
+        *
+        * @param $type string, one of the following:
+        *    - error: display a return to link ignoring $wgRedirectOnLogin
+        *    - success: display a return to link using $wgRedirectOnLogin if 
needed
+        *    - successredirect: send an HTTP redirect using $wgRedirectOnLogin 
if needed
+        * @param string $returnTo
+        * @param array|string $returnToQuery
+        * @param bool $stickHTTPs Keep redirect link on HTTPs
+        * @since 1.22
+        */
+       public function showReturnToPage(
+               $type, $returnTo = '', $returnToQuery = '', $stickHTTPs = false
+       ) {
+               $this->mReturnTo = $returnTo;
+               $this->mReturnToQuery = $returnToQuery;
+               $this->mStickHTTPS = $stickHTTPs;
+               $this->executeReturnTo( $type );
+       }
+
+       /**
+        * Add a "return to" link or redirect to it.
         *
         * @param $type string, one of the following:
         *    - error: display a return to link ignoring $wgRedirectOnLogin

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Idd71cac47195402ebffeb7047e91efb200a32b58
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz <asch...@wikimedia.org>
Gerrit-Reviewer: Anomie <bjor...@wikimedia.org>
Gerrit-Reviewer: CSteipp <cste...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to