* (bug 19186) Special:UserLogin's title on Special:SpecialPages now says "create...
authorAlexandre Emsenhuber <ialex@users.mediawiki.org>
Sat, 29 Oct 2011 13:21:22 +0000 (13:21 +0000)
committerAlexandre Emsenhuber <ialex@users.mediawiki.org>
Sat, 29 Oct 2011 13:21:22 +0000 (13:21 +0000)
* Also added a missing call to setHeaders()

RELEASE-NOTES-1.19
includes/specials/SpecialUserlogin.php

index 4c7a551..bd0b485 100644 (file)
@@ -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.
index 65e258f..b1d2730 100644 (file)
@@ -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 );
        }