r102920 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r102919‎ | r102920 | r102921 >
Date:22:57, 13 November 2011
Author:aaron
Status:deferred
Tags:
Comment:
* FU r102919: fixed confusing of area name and form input name (e.g. "wpArea-*")
* Removed $mAreaSet from RequestAccountPage as with ConfirmAccountsPage
Modified paths:
  • /trunk/extensions/ConfirmAccount/frontend/specialpages/actions/ConfirmAccount_body.php (modified) (history)
  • /trunk/extensions/ConfirmAccount/frontend/specialpages/actions/RequestAccount_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ConfirmAccount/frontend/specialpages/actions/RequestAccount_body.php
@@ -11,8 +11,6 @@
1212 protected $mType;
1313 /** @var array */
1414 protected $mAreas;
15 - /** @var array */
16 - protected $mAreaSet;
1715
1816 protected $mPrevAttachment;
1917 protected $mForgotAttachment;
@@ -66,14 +64,10 @@
6765 $this->mType = isset( $wgAccountRequestTypes[$this->mType] ) ?
6866 $this->mType : 0;
6967 # Load areas user plans to be active in...
70 - $this->mAreas = $this->mAreaSet = array();
 68+ $this->mAreas = array();
7169 foreach ( ConfirmAccount::getUserAreaConfig() as $name => $conf ) {
7270 $formName = "wpArea-" . htmlspecialchars( str_replace( ' ', '_', $name ) );
73 - $this->mAreas[$formName] = $request->getInt( $formName, -1 );
74 - # Make a simple list of interests
75 - if ( $this->mAreas[$formName] > 0 ) {
76 - $this->mAreaSet[] = $name;
77 - }
 71+ $this->mAreas[$name] = $request->getInt( $formName, -1 );
7872 }
7973 # We may be confirming an email address here
8074 $emailCode = $request->getText( 'wpEmailToken' );
@@ -163,7 +157,7 @@
164158 $pg = '';
165159 }
166160 $form .= "<td>" .
167 - Xml::checkLabel( $name, $formName, $formName, $this->mAreas[$formName] > 0 ) .
 161+ Xml::checkLabel( $name, $formName, $formName, $this->mAreas[$name] > 0 ) .
168162 " {$pg}</td>\n";
169163 }
170164 $form .= "</tr></table></div>";
@@ -268,6 +262,12 @@
269263 }
270264
271265 # Build submission object...
 266+ $areaSet = array(); // make a simple list of interests
 267+ foreach ( $this->mAreas as $area => $val ) {
 268+ if ( $val > 0 ) {
 269+ $areaSet[] = $area;
 270+ }
 271+ }
272272 $submission = new AccountRequestSubmission(
273273 $this->getUser(),
274274 array(
@@ -279,7 +279,7 @@
280280 'notes' => $this->mNotes,
281281 'urls' => $this->mUrls,
282282 'type' => $this->mType,
283 - 'areas' => $this->mAreaSet,
 283+ 'areas' => $areaSet,
284284 'registration' => wfTimestampNow(),
285285 'ip' => $this->getRequest()->getIP(),
286286 'attachmentPrevName' => $this->mPrevAttachment,
Index: trunk/extensions/ConfirmAccount/frontend/specialpages/actions/ConfirmAccount_body.php
@@ -69,7 +69,7 @@
7070 $this->reqAreas = array();
7171 foreach ( ConfirmAccount::getUserAreaConfig() as $name => $conf ) {
7272 $formName = "wpArea-" . htmlspecialchars( str_replace(' ','_', $name ) );
73 - $this->reqAreas[$formName] = $request->getInt( $formName, -1 );
 73+ $this->reqAreas[$name] = $request->getInt( $formName, -1 );
7474 }
7575 # Load in the UserAccountRequest obj
7676 $this->loadAccountRequest( $this->acrID, $request->wasPosted() );
@@ -318,7 +318,7 @@
319319 $pg = '';
320320 }
321321 $form .= "<td>" .
322 - Xml::checkLabel( $name, $formName, $formName, $this->reqAreas[$formName] > 0 ) .
 322+ Xml::checkLabel( $name, $formName, $formName, $this->reqAreas[$name] > 0 ) .
323323 " {$pg}</td>\n";
324324 }
325325 $form .= "</tr></table></div>";
@@ -443,7 +443,7 @@
444444 }
445445
446446 # Build submission object...
447 - $areaSet = array();
 447+ $areaSet = array(); // make a simple list of interests
448448 foreach ( $this->reqAreas as $area => $val ) {
449449 if ( $val > 0 ) {
450450 $areaSet[] = $area;

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r102919* ConfirmAccountPage:...aaron22:50, 13 November 2011

Status & tagging log