(bug 23222) The "login again" link on Special:Userlogout now has returnto parameter
authorAlexandre Emsenhuber <ialex.wiki@gmail.com>
Sat, 6 Oct 2012 12:50:28 +0000 (14:50 +0200)
committerAlexandre Emsenhuber <ialex.wiki@gmail.com>
Sat, 6 Oct 2012 13:05:31 +0000 (15:05 +0200)
It is much more user-firendly for user that logout and then click the "login again"
to have the "Return to" links pointing to the page they were before logging out.

Based on patch by Ilmari Karonen.

Change-Id: Ia63d7743b9a02ee81eb76cdd34da375a66589059

includes/specials/SpecialUserlogout.php
languages/messages/MessagesEn.php
languages/messages/MessagesQqq.php

index ab2bf0a..4be36c6 100644 (file)
@@ -49,8 +49,11 @@ class SpecialUserlogout extends UnlistedSpecialPage {
                $oldName = $user->getName();
                $user->logout();
 
+               $loginURL = SpecialPage::getTitleFor( 'Userlogin' )->getFullURL(
+                       $this->getRequest()->getValues( 'returnto', 'returntoquery' ) );
+
                $out = $this->getOutput();
-               $out->addWikiMsg( 'logouttext' );
+               $out->addWikiMsg( 'logouttext', $loginURL );
 
                // Hook.
                $injected_html = '';
index 8971421..bcff642 100644 (file)
@@ -1065,7 +1065,7 @@ The administrator who locked it offered this explanation: "$3".',
 # Login and logout pages
 'logouttext'                 => "'''You are now logged out.'''
 
-You can continue to use {{SITENAME}} anonymously, or you can [[Special:UserLogin|log in again]] as the same or as a different user.
+You can continue to use {{SITENAME}} anonymously, or you can <span class='plainlinks'>[$1 log in again]</span> as the same or as a different user.
 Note that some pages may continue to be displayed as if you were still logged in, until you clear your browser cache.",
 'welcomecreation'            => '== Welcome, $1! ==
 Your account has been created.
index a895f0b..19fe723 100644 (file)
@@ -726,7 +726,8 @@ See also {{msg-mw|protectedinterface}}.',
 'exception-nologin-text' => 'Generic reason displayed on error page when a user is not logged in. Message used by the UserNotLoggedIn exception.',
 
 # Login and logout pages
-'logouttext' => 'Log out message',
+'logouttext' => 'Log out message
+* $1 is an URL to [[Special:Userlogin]] containing returnto and returntoquery parameters',
 'welcomecreation' => 'The welcome message users see after registering a user account. $1 is the username of the new user.',
 'yourname' => "In user preferences
 
@@ -3562,7 +3563,7 @@ Parameters:
 Start with a lowercase letter, unless the first word is “SVG”.',
 'svg-long-desc-animated' => 'Displayed under an SVG image at the image description page if the image is animated. Non-animated images use {{msg-mw|svg-long-desc}}.
 * $1 is the width in pixels
-* $2 is the height in pixels, and 
+* $2 is the height in pixels, and
 * $3 is the file size including a unit (for example "10 KB").
 
 Start with a lowercase letter, unless the first word is “SVG”.',