From 6e8172d7ff7f6e6d6b69ffc3e0a3380d252741aa Mon Sep 17 00:00:00 2001 From: Jens Frank Date: Fri, 6 Aug 2004 05:14:09 +0000 Subject: [PATCH] Bug [ 991515 ]: moved wgAccountCreationThrottle test so that unsuccesful attempts are not counted. --- includes/SpecialUserlogin.php | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/includes/SpecialUserlogin.php b/includes/SpecialUserlogin.php index f69fc8ba49..32799e55ab 100644 --- a/includes/SpecialUserlogin.php +++ b/includes/SpecialUserlogin.php @@ -128,18 +128,6 @@ class LoginForm { global $wgMaxNameChars; global $wgMemc, $wgAccountCreationThrottle, $wgDBname, $wgIP; - if ( $wgAccountCreationThrottle ) { - $key = "$wgDBname:acctcreate:ip:$wgIP"; - $value = $wgMemc->incr( $key ); - if ( !$value ) { - $wgMemc->set( $key, 1, 86400 ); - } - if ( $value > $wgAccountCreationThrottle ) { - $this->throttleHit( $wgAccountCreationThrottle ); - return; - } - } - if (!$wgUser->isAllowedToCreateAccount()) { $this->userNotPrivilegedMessage(); return; @@ -170,6 +158,19 @@ class LoginForm { $this->mainLoginForm( wfMsg( "userexists" ) ); return; } + + if ( $wgAccountCreationThrottle ) { + $key = "$wgDBname:acctcreate:ip:$wgIP"; + $value = $wgMemc->incr( $key ); + if ( !$value ) { + $wgMemc->set( $key, 1, 86400 ); + } + if ( $value > $wgAccountCreationThrottle ) { + $this->throttleHit( $wgAccountCreationThrottle ); + return; + } + } + $u->addToDatabase(); $u->setPassword( $this->mPassword ); $u->setEmail( $this->mEmail ); -- 2.20.1