when whitelistread prevents a page being viewed, add returnto= to the URL
authorRiver Tarnell <kateturner@users.mediawiki.org>
Wed, 3 Aug 2005 22:49:43 +0000 (22:49 +0000)
committerRiver Tarnell <kateturner@users.mediawiki.org>
Wed, 3 Aug 2005 22:49:43 +0000 (22:49 +0000)
parameters for Special:Userlogin.

includes/OutputPage.php
languages/Language.php

index ae4694b..df6ff66 100644 (file)
@@ -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.
index a4f0548..c5b37b2 100644 (file)
@@ -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)',