Index: trunk/phase3/docs/hooks.txt |
— | — | @@ -849,6 +849,9 @@ |
850 | 850 | $editToken: The user's edit token. |
851 | 851 | &$hookErr: Out-param for the error. Passed as the parameters to OutputPage::showErrorPage. |
852 | 852 | |
| 853 | +'exemptFromAccountCreationThrottle': Exemption from the account creation throttle |
| 854 | +$ip: The ip address of the user |
| 855 | + |
853 | 856 | 'ExtensionTypes': called when generating the extensions credits, use this to change the tables headers |
854 | 857 | &$extTypes: associative array of extensions types |
855 | 858 | |
Index: trunk/phase3/RELEASE-NOTES-1.19 |
— | — | @@ -45,6 +45,7 @@ |
46 | 46 | although they are not used there. |
47 | 47 | * (bug 30451) Add page_props to RefreshLinks::deleteLinksFromNonexistent |
48 | 48 | * (bug 30450) Clear page_props table on page deletion |
| 49 | +* Hook added to check for exempt from account creation throttle |
49 | 50 | |
50 | 51 | === Bug fixes in 1.19 === |
51 | 52 | * $wgUploadNavigationUrl should be used for file redlinks if |
Index: trunk/phase3/includes/specials/SpecialUserlogin.php |
— | — | @@ -377,17 +377,23 @@ |
378 | 378 | return false; |
379 | 379 | } |
380 | 380 | |
381 | | - if ( $wgAccountCreationThrottle && $wgUser->isPingLimitable() ) { |
382 | | - $key = wfMemcKey( 'acctcreate', 'ip', $ip ); |
383 | | - $value = $wgMemc->get( $key ); |
384 | | - if ( !$value ) { |
385 | | - $wgMemc->set( $key, 0, 86400 ); |
| 381 | + // Hook point to check for exempt from account creation throttle |
| 382 | + if ( !wfRunHooks( 'exemptFromAccountCreationThrottle', array( $ip ) ) ) { |
| 383 | + wfDebug( "LoginForm::exemptFromAccountCreationThrottle: a hook allowed account creation w/o throttle\n" ); |
| 384 | + } else { |
| 385 | + if ( ( $wgAccountCreationThrottle && $wgUser->isPingLimitable() ) ) { |
| 386 | + wfDebugLog( 'CACT', "IN der core Throttle Abfrage\n" ); |
| 387 | + $key = wfMemcKey( 'acctcreate', 'ip', $ip ); |
| 388 | + $value = $wgMemc->get( $key ); |
| 389 | + if ( !$value ) { |
| 390 | + $wgMemc->set( $key, 0, 86400 ); |
| 391 | + } |
| 392 | + if ( $value >= $wgAccountCreationThrottle ) { |
| 393 | + $this->throttleHit( $wgAccountCreationThrottle ); |
| 394 | + return false; |
| 395 | + } |
| 396 | + $wgMemc->incr( $key ); |
386 | 397 | } |
387 | | - if ( $value >= $wgAccountCreationThrottle ) { |
388 | | - $this->throttleHit( $wgAccountCreationThrottle ); |
389 | | - return false; |
390 | | - } |
391 | | - $wgMemc->incr( $key ); |
392 | 398 | } |
393 | 399 | |
394 | 400 | if( !$wgAuth->addUser( $u, $this->mPassword, $this->mEmail, $this->mRealName ) ) { |