From 8c71740a004aec5dee1e2058eaa294294935ff17 Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Sat, 6 Oct 2012 14:50:28 +0200 Subject: [PATCH] (bug 23222) The "login again" link on Special:Userlogout now has returnto parameter 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 | 5 ++++- languages/messages/MessagesEn.php | 2 +- languages/messages/MessagesQqq.php | 5 +++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/includes/specials/SpecialUserlogout.php b/includes/specials/SpecialUserlogout.php index ab2bf0ac4b..4be36c6174 100644 --- a/includes/specials/SpecialUserlogout.php +++ b/includes/specials/SpecialUserlogout.php @@ -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 = ''; diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index 8971421c30..bcff6420b3 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -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 [$1 log in again] 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. diff --git a/languages/messages/MessagesQqq.php b/languages/messages/MessagesQqq.php index a895f0b0a5..19fe7231e0 100644 --- a/languages/messages/MessagesQqq.php +++ b/languages/messages/MessagesQqq.php @@ -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”.', -- 2.20.1