Index: trunk/extensions/ConfirmAccount/frontend/specialpages/actions/RequestAccount_body.php |
— | — | @@ -11,8 +11,6 @@ |
12 | 12 | protected $mType; |
13 | 13 | /** @var array */ |
14 | 14 | protected $mAreas; |
15 | | - /** @var array */ |
16 | | - protected $mAreaSet; |
17 | 15 | |
18 | 16 | protected $mPrevAttachment; |
19 | 17 | protected $mForgotAttachment; |
— | — | @@ -66,14 +64,10 @@ |
67 | 65 | $this->mType = isset( $wgAccountRequestTypes[$this->mType] ) ? |
68 | 66 | $this->mType : 0; |
69 | 67 | # Load areas user plans to be active in... |
70 | | - $this->mAreas = $this->mAreaSet = array(); |
| 68 | + $this->mAreas = array(); |
71 | 69 | foreach ( ConfirmAccount::getUserAreaConfig() as $name => $conf ) { |
72 | 70 | $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 ); |
78 | 72 | } |
79 | 73 | # We may be confirming an email address here |
80 | 74 | $emailCode = $request->getText( 'wpEmailToken' ); |
— | — | @@ -163,7 +157,7 @@ |
164 | 158 | $pg = ''; |
165 | 159 | } |
166 | 160 | $form .= "<td>" . |
167 | | - Xml::checkLabel( $name, $formName, $formName, $this->mAreas[$formName] > 0 ) . |
| 161 | + Xml::checkLabel( $name, $formName, $formName, $this->mAreas[$name] > 0 ) . |
168 | 162 | " {$pg}</td>\n"; |
169 | 163 | } |
170 | 164 | $form .= "</tr></table></div>"; |
— | — | @@ -268,6 +262,12 @@ |
269 | 263 | } |
270 | 264 | |
271 | 265 | # 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 | + } |
272 | 272 | $submission = new AccountRequestSubmission( |
273 | 273 | $this->getUser(), |
274 | 274 | array( |
— | — | @@ -279,7 +279,7 @@ |
280 | 280 | 'notes' => $this->mNotes, |
281 | 281 | 'urls' => $this->mUrls, |
282 | 282 | 'type' => $this->mType, |
283 | | - 'areas' => $this->mAreaSet, |
| 283 | + 'areas' => $areaSet, |
284 | 284 | 'registration' => wfTimestampNow(), |
285 | 285 | 'ip' => $this->getRequest()->getIP(), |
286 | 286 | 'attachmentPrevName' => $this->mPrevAttachment, |
Index: trunk/extensions/ConfirmAccount/frontend/specialpages/actions/ConfirmAccount_body.php |
— | — | @@ -69,7 +69,7 @@ |
70 | 70 | $this->reqAreas = array(); |
71 | 71 | foreach ( ConfirmAccount::getUserAreaConfig() as $name => $conf ) { |
72 | 72 | $formName = "wpArea-" . htmlspecialchars( str_replace(' ','_', $name ) ); |
73 | | - $this->reqAreas[$formName] = $request->getInt( $formName, -1 ); |
| 73 | + $this->reqAreas[$name] = $request->getInt( $formName, -1 ); |
74 | 74 | } |
75 | 75 | # Load in the UserAccountRequest obj |
76 | 76 | $this->loadAccountRequest( $this->acrID, $request->wasPosted() ); |
— | — | @@ -318,7 +318,7 @@ |
319 | 319 | $pg = ''; |
320 | 320 | } |
321 | 321 | $form .= "<td>" . |
322 | | - Xml::checkLabel( $name, $formName, $formName, $this->reqAreas[$formName] > 0 ) . |
| 322 | + Xml::checkLabel( $name, $formName, $formName, $this->reqAreas[$name] > 0 ) . |
323 | 323 | " {$pg}</td>\n"; |
324 | 324 | } |
325 | 325 | $form .= "</tr></table></div>"; |
— | — | @@ -443,7 +443,7 @@ |
444 | 444 | } |
445 | 445 | |
446 | 446 | # Build submission object... |
447 | | - $areaSet = array(); |
| 447 | + $areaSet = array(); // make a simple list of interests |
448 | 448 | foreach ( $this->reqAreas as $area => $val ) { |
449 | 449 | if ( $val > 0 ) { |
450 | 450 | $areaSet[] = $area; |