Index: trunk/extensions/ConfirmAccount/ConfirmAccount_body.php |
— | — | @@ -134,7 +134,6 @@ |
135 | 135 | |
136 | 136 | function doSubmit() { |
137 | 137 | global $wgOut, $wgUser, $wgAuth, $wgAccountRequestThrottle, $wgMemc; |
138 | | - |
139 | 138 | # Now create a dummy user ($u) and check if it is valid |
140 | 139 | $name = trim( $this->mUsername ); |
141 | 140 | $u = User::newFromName( $name, 'creatable' ); |
— | — | @@ -142,6 +141,15 @@ |
143 | 142 | $this->showForm( wfMsgHtml('noname') ); |
144 | 143 | return; |
145 | 144 | } |
| 145 | + # No request spamming... |
| 146 | + if( $wgAccountRequestThrottle && ( !method_exists($u,'isPingLimitable') || $wgUser->isPingLimitable() ) ) { |
| 147 | + $key = wfMemcKey( 'acctrequest', 'ip', wfGetIP() ); |
| 148 | + $value = $wgMemc->get( $key ); |
| 149 | + if( $value > $wgAccountRequestThrottle ) { |
| 150 | + $this->throttleHit( $wgAccountRequestThrottle ); |
| 151 | + return; |
| 152 | + } |
| 153 | + } |
146 | 154 | # Check if already in use |
147 | 155 | if( 0 != $u->idForName() || $wgAuth->userExists( $u->getName() ) ) { |
148 | 156 | $this->showForm( wfMsgHtml('userexists') ); |
— | — | @@ -220,7 +228,7 @@ |
221 | 229 | } |
222 | 230 | if( $value > $wgAccountRequestThrottle ) { |
223 | 231 | $this->throttleHit( $wgAccountRequestThrottle ); |
224 | | - return false; |
| 232 | + return; |
225 | 233 | } |
226 | 234 | } |
227 | 235 | # Done! |