From 8e8cc38a745dda3ddf2db2e1f59152eb594227bc Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Sat, 3 Jan 2009 06:25:24 +0000 Subject: [PATCH] (bug 15320) Show login page if not logged in (for watchlist) --- includes/specials/SpecialWatchlist.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/includes/specials/SpecialWatchlist.php b/includes/specials/SpecialWatchlist.php index 61dd6b3eea..9c9c1620e7 100644 --- a/includes/specials/SpecialWatchlist.php +++ b/includes/specials/SpecialWatchlist.php @@ -20,10 +20,14 @@ function wfSpecialWatchlist( $par ) { # Anons don't get a watchlist if( $wgUser->isAnon() ) { - $wgOut->setPageTitle( wfMsg( 'watchnologin' ) ); $llink = $skin->makeKnownLinkObj( SpecialPage::getTitleFor( 'Userlogin' ), wfMsgHtml( 'loginreqlink' ), 'returnto=' . $specialTitle->getPrefixedUrl() ); $wgOut->addHTML( wfMsgWikiHtml( 'watchlistanontext', $llink ) ); + # Add login form for convenience + $form = new LoginForm( $wgRequest ); + $form->execute(); + # Set page title (also LoginForm sets it too, but we prefer this one) + $wgOut->setPageTitle( wfMsg( 'watchnologin' ) ); return; } -- 2.20.1