From d45970ab68b80aa757d78349343a729edd8b1ecc Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Sat, 29 Oct 2011 13:21:22 +0000 Subject: [PATCH] * (bug 19186) Special:UserLogin's title on Special:SpecialPages now says "create account" when the user cannot create an account * Also added a missing call to setHeaders() --- RELEASE-NOTES-1.19 | 2 ++ includes/specials/SpecialUserlogin.php | 13 ++++++------- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/RELEASE-NOTES-1.19 b/RELEASE-NOTES-1.19 index 4c7a551377..bd0b485533 100644 --- a/RELEASE-NOTES-1.19 +++ b/RELEASE-NOTES-1.19 @@ -120,6 +120,8 @@ production. * (bug 31921) Magic words REVISIONDAY, REVISIONMONTH and REVISIONYEAR now give current values on preview * (bug 29912) Unit tests break if parsertest tables are still present +* (bug 19186) Special:UserLogin's title on Special:SpecialPages now says + "create account" when the user cannot create an account === API changes in 1.19 === * (bug 19838) siprop=interwikimap can now use the interwiki cache. diff --git a/includes/specials/SpecialUserlogin.php b/includes/specials/SpecialUserlogin.php index 65e258fa0d..b1d2730978 100644 --- a/includes/specials/SpecialUserlogin.php +++ b/includes/specials/SpecialUserlogin.php @@ -139,12 +139,18 @@ class LoginForm extends SpecialPage { } } + function getDescription() { + return $this->msg( $this->getUser()->isAllowed( 'createaccount' ) ? + 'userlogin' : 'userloginnocreate' )->text(); + } + public function execute( $par ) { if ( session_id() == '' ) { wfSetupSession(); } $this->load(); + $this->setHeaders(); if ( $par == 'signup' ) { # Check for [[Special:Userlogin/signup]] $this->mType = 'signup'; @@ -1074,14 +1080,7 @@ class LoginForm extends SpecialPage { wfRunHooks( 'UserLoginForm', array( &$template ) ); } - // Changes the title depending on permissions for creating account $out = $this->getOutput(); - if ( $user->isAllowed( 'createaccount' ) ) { - $out->setPageTitle( $this->msg( 'userlogin' ) ); - } else { - $out->setPageTitle( $this->msg( 'userloginnocreate' ) ); - } - $out->disallowUserJs(); // just in case... $out->addTemplate( $template ); } -- 2.20.1