From ec030e995715ae2e451f1804a7fca6b1ea0e18de Mon Sep 17 00:00:00 2001 From: River Tarnell Date: Wed, 3 Aug 2005 22:49:43 +0000 Subject: [PATCH] when whitelistread prevents a page being viewed, add returnto= to the URL parameters for Special:Userlogin. --- includes/OutputPage.php | 6 +++++- languages/Language.php | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/includes/OutputPage.php b/includes/OutputPage.php index ae4694bc48..df6ff66a8f 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -639,7 +639,11 @@ class OutputPage { $this->setRobotpolicy( 'noindex,nofollow' ); $this->setArticleFlag( false ); $this->mBodytext = ''; - $this->addWikiText( wfMsg( 'loginreqtext' ) ); + $loginpage = Title::makeTitle(NS_SPECIAL, 'Userlogin'); + $sk = $wgUser->getSkin(); + $loginlink = $sk->makeKnownLinkObj($loginpage, wfMsg('loginreqlink'), + 'returnto=' . htmlspecialchars($wgTitle->getPrefixedDBkey())); + $this->addHTML( wfMsgHtml( 'loginreqpagetext', $loginlink ) ); # We put a comment in the .html file so a Sysop can diagnose the page the # user can't see. diff --git a/languages/Language.php b/languages/Language.php index a4f05489c9..c5b37b2c8f 100644 --- a/languages/Language.php +++ b/languages/Language.php @@ -697,7 +697,8 @@ Your IP address is $3. Please include this address in any queries you make. 'whitelistacctitle' => 'You are not allowed to create an account', 'whitelistacctext' => 'To be allowed to create accounts in this Wiki you have to [[Special:Userlogin|log]] in and have the appropriate permissions.', 'loginreqtitle' => 'Login Required', -'loginreqtext' => 'You must [[special:Userlogin|login]] to view other pages.', +'loginreqlink' => 'login', +'loginreqpagetext' => 'You must $1 to view other pages.', 'accmailtitle' => 'Password sent.', 'accmailtext' => "The password for '$1' has been sent to $2.", 'newarticle' => '(New)', -- 2.20.1