New hook point to exempt an IP address from the account creation throttle. Redo of r95041 per Niklas CR
Needed for a new extension to make (mass) account creation easier for schools/colleges etc
This commit is contained in:
parent
7a06cb7d58
commit
2d2d98e6eb
3 changed files with 20 additions and 10 deletions
|
|
@ -45,6 +45,7 @@ production.
|
||||||
although they are not used there.
|
although they are not used there.
|
||||||
* (bug 30451) Add page_props to RefreshLinks::deleteLinksFromNonexistent
|
* (bug 30451) Add page_props to RefreshLinks::deleteLinksFromNonexistent
|
||||||
* (bug 30450) Clear page_props table on page deletion
|
* (bug 30450) Clear page_props table on page deletion
|
||||||
|
* Hook added to check for exempt from account creation throttle
|
||||||
|
|
||||||
=== Bug fixes in 1.19 ===
|
=== Bug fixes in 1.19 ===
|
||||||
* $wgUploadNavigationUrl should be used for file redlinks if
|
* $wgUploadNavigationUrl should be used for file redlinks if
|
||||||
|
|
|
||||||
|
|
@ -849,6 +849,9 @@ $user: The user who is trying to email another user.
|
||||||
$editToken: The user's edit token.
|
$editToken: The user's edit token.
|
||||||
&$hookErr: Out-param for the error. Passed as the parameters to OutputPage::showErrorPage.
|
&$hookErr: Out-param for the error. Passed as the parameters to OutputPage::showErrorPage.
|
||||||
|
|
||||||
|
'exemptFromAccountCreationThrottle': Exemption from the account creation throttle
|
||||||
|
$ip: The ip address of the user
|
||||||
|
|
||||||
'ExtensionTypes': called when generating the extensions credits, use this to change the tables headers
|
'ExtensionTypes': called when generating the extensions credits, use this to change the tables headers
|
||||||
&$extTypes: associative array of extensions types
|
&$extTypes: associative array of extensions types
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -377,17 +377,23 @@ class LoginForm extends SpecialPage {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( $wgAccountCreationThrottle && $wgUser->isPingLimitable() ) {
|
// Hook point to check for exempt from account creation throttle
|
||||||
$key = wfMemcKey( 'acctcreate', 'ip', $ip );
|
if ( !wfRunHooks( 'exemptFromAccountCreationThrottle', array( $ip ) ) ) {
|
||||||
$value = $wgMemc->get( $key );
|
wfDebug( "LoginForm::exemptFromAccountCreationThrottle: a hook allowed account creation w/o throttle\n" );
|
||||||
if ( !$value ) {
|
} else {
|
||||||
$wgMemc->set( $key, 0, 86400 );
|
if ( ( $wgAccountCreationThrottle && $wgUser->isPingLimitable() ) ) {
|
||||||
|
wfDebugLog( 'CACT', "IN der core Throttle Abfrage\n" );
|
||||||
|
$key = wfMemcKey( 'acctcreate', 'ip', $ip );
|
||||||
|
$value = $wgMemc->get( $key );
|
||||||
|
if ( !$value ) {
|
||||||
|
$wgMemc->set( $key, 0, 86400 );
|
||||||
|
}
|
||||||
|
if ( $value >= $wgAccountCreationThrottle ) {
|
||||||
|
$this->throttleHit( $wgAccountCreationThrottle );
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
$wgMemc->incr( $key );
|
||||||
}
|
}
|
||||||
if ( $value >= $wgAccountCreationThrottle ) {
|
|
||||||
$this->throttleHit( $wgAccountCreationThrottle );
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
$wgMemc->incr( $key );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if( !$wgAuth->addUser( $u, $this->mPassword, $this->mEmail, $this->mRealName ) ) {
|
if( !$wgAuth->addUser( $u, $this->mPassword, $this->mEmail, $this->mRealName ) ) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue