From f3b50f965dc23e17bc5ffb9698cedff84cb85a02 Mon Sep 17 00:00:00 2001 From: Aryeh Gregor Date: Fri, 20 Oct 2006 20:10:26 +0000 Subject: [PATCH] (bug 7644) User creations that are aborted by hooks shouldn't be counted against account creations per day limit --- RELEASE-NOTES | 2 ++ includes/SpecialUserlogin.php | 20 ++++++++++---------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index cb61fc37eb..e9400a4c83 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -63,6 +63,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN styling * (bug 6276) Stopped search field from getting too large in Cologne Blue * Fixed duplicate name/id value of "search" in Cologne Blue +* (bug 7644) User creations that are aborted by hooks shouldn't be counted + against account creations per day limit == Languages updated == diff --git a/includes/SpecialUserlogin.php b/includes/SpecialUserlogin.php index 150b88f4db..264ae149b8 100644 --- a/includes/SpecialUserlogin.php +++ b/includes/SpecialUserlogin.php @@ -157,12 +157,12 @@ class LoginForm { global $wgLoginLanguageSelector; if( $wgLoginLanguageSelector && $this->mLanguage ) $u->setOption( 'language', $this->mLanguage ); - + # Save user settings and send out an email authentication message if needed $u->saveSettings(); if( $wgEmailAuthentication && User::isValidEmailAddr( $u->getEmail() ) ) $u->sendConfirmationMail(); - + # If not logged in, assume the new account as the current one and set session cookies # then show a "welcome" message or a "need cookies" message as needed if( $wgUser->isAnon() ) { @@ -257,6 +257,14 @@ class LoginForm { return false; } + $abortError = ''; + if( !wfRunHooks( 'AbortNewAccount', array( $u, &$abortError ) ) ) { + // Hook point to add extra creation throttles and blocks + wfDebug( "LoginForm::addNewAccountInternal: a hook blocked creation\n" ); + $this->mainLoginForm( $abortError ); + return false; + } + if ( $wgAccountCreationThrottle ) { $key = wfMemcKey( 'acctcreate', 'ip', $ip ); $value = $wgMemc->incr( $key ); @@ -269,14 +277,6 @@ class LoginForm { } } - $abortError = ''; - if( !wfRunHooks( 'AbortNewAccount', array( $u, &$abortError ) ) ) { - // Hook point to add extra creation throttles and blocks - wfDebug( "LoginForm::addNewAccountInternal: a hook blocked creation\n" ); - $this->mainLoginForm( $abortError ); - return false; - } - if( !$wgAuth->addUser( $u, $this->mPassword ) ) { $this->mainLoginForm( wfMsg( 'externaldberror' ) ); return false; -- 2.20.1