r101260 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r101259‎ | r101260 | r101261 >
Date:13:21, 29 October 2011
Author:ialex
Status:ok
Tags:
Comment:
* (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()
Modified paths:
  • /trunk/phase3/RELEASE-NOTES-1.19 (modified) (history)
  • /trunk/phase3/includes/specials/SpecialUserlogin.php (modified) (history)

Diff [purge]

Index: trunk/phase3/RELEASE-NOTES-1.19
@@ -120,6 +120,8 @@
121121 * (bug 31921) Magic words REVISIONDAY, REVISIONMONTH and REVISIONYEAR now give
122122 current values on preview
123123 * (bug 29912) Unit tests break if parsertest tables are still present
 124+* (bug 19186) Special:UserLogin's title on Special:SpecialPages now says
 125+ "create account" when the user cannot create an account
124126
125127 === API changes in 1.19 ===
126128 * (bug 19838) siprop=interwikimap can now use the interwiki cache.
Index: trunk/phase3/includes/specials/SpecialUserlogin.php
@@ -139,12 +139,18 @@
140140 }
141141 }
142142
 143+ function getDescription() {
 144+ return $this->msg( $this->getUser()->isAllowed( 'createaccount' ) ?
 145+ 'userlogin' : 'userloginnocreate' )->text();
 146+ }
 147+
143148 public function execute( $par ) {
144149 if ( session_id() == '' ) {
145150 wfSetupSession();
146151 }
147152
148153 $this->load();
 154+ $this->setHeaders();
149155
150156 if ( $par == 'signup' ) { # Check for [[Special:Userlogin/signup]]
151157 $this->mType = 'signup';
@@ -1074,14 +1080,7 @@
10751081 wfRunHooks( 'UserLoginForm', array( &$template ) );
10761082 }
10771083
1078 - // Changes the title depending on permissions for creating account
10791084 $out = $this->getOutput();
1080 - if ( $user->isAllowed( 'createaccount' ) ) {
1081 - $out->setPageTitle( $this->msg( 'userlogin' ) );
1082 - } else {
1083 - $out->setPageTitle( $this->msg( 'userloginnocreate' ) );
1084 - }
1085 -
10861085 $out->disallowUserJs(); // just in case...
10871086 $out->addTemplate( $template );
10881087 }

Status & tagging log