Index: trunk/extensions/ConfirmAccount/presentation/specialpages/actions/RequestAccount_body.php |
— | — | @@ -15,21 +15,20 @@ |
16 | 16 | } |
17 | 17 | |
18 | 18 | function execute( $par ) { |
19 | | - global $wgUseRealNamesOnly, |
20 | | - $wgAccountRequestToS, $wgAccountRequestExtraInfo, $wgAccountRequestTypes; |
21 | | - # If a user cannot make accounts, don't let them request them either |
22 | | - global $wgAccountRequestWhileBlocked; |
| 19 | + global $wgUseRealNamesOnly, $wgAccountRequestToS, $wgAccountRequestExtraInfo; |
| 20 | + global $wgAccountRequestTypes, $wgAccountRequestWhileBlocked; |
23 | 21 | |
24 | 22 | $reqUser = $this->getUser(); |
25 | 23 | $request = $this->getRequest(); |
26 | | - $out = $this->getOutput(); |
27 | | - if ( !$wgAccountRequestWhileBlocked && $reqUser->isBlockedFromCreateAccount() ) { |
28 | | - $out->blockedPage(); |
29 | | - return; |
| 24 | + |
| 25 | + # If a user cannot make accounts, don't let them request them either |
| 26 | + if ( !$wgAccountRequestWhileBlocked ) { |
| 27 | + if ( ( $block = $reqUser->isBlockedFromCreateAccount() ) ) { |
| 28 | + throw new UserBlockedError( $block ); |
| 29 | + } |
30 | 30 | } |
31 | 31 | if ( wfReadOnly() ) { |
32 | | - $out->readOnlyPage(); |
33 | | - return; |
| 32 | + throw new ReadOnlyError(); |
34 | 33 | } |
35 | 34 | |
36 | 35 | $this->setHeaders(); |
— | — | @@ -52,7 +51,8 @@ |
53 | 52 | $this->mToS = $wgAccountRequestToS ? |
54 | 53 | $request->getBool( 'wpToS' ) : false; |
55 | 54 | $this->mType = $request->getInt( 'wpType' ); |
56 | | - $this->mType = isset( $wgAccountRequestTypes[$this->mType] ) ? $this->mType : 0; |
| 55 | + $this->mType = isset( $wgAccountRequestTypes[$this->mType] ) ? |
| 56 | + $this->mType : 0; |
57 | 57 | # Load areas user plans to be active in... |
58 | 58 | $this->mAreas = $this->mAreaSet = array(); |
59 | 59 | foreach ( ConfirmAccount::getUserAreaConfig() as $name => $conf ) { |
— | — | @@ -75,7 +75,8 @@ |
76 | 76 | } else { |
77 | 77 | $this->showForm(); |
78 | 78 | } |
79 | | - $out->addModules( 'ext.confirmAccount' ); // CSS |
| 79 | + |
| 80 | + $this->getOutput()->addModules( 'ext.confirmAccount' ); // CSS |
80 | 81 | } |
81 | 82 | |
82 | 83 | protected function showForm( $msg = '', $forgotFile = 0 ) { |