From: Aryeh Gregor Date: Fri, 20 Oct 2006 20:10:26 +0000 (+0000) Subject: (bug 7644) User creations that are aborted by hooks shouldn't be counted against... X-Git-Tag: 1.31.0-rc.0~55424 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dmes_infos.php?a=commitdiff_plain;h=f3b50f965dc23e17bc5ffb9698cedff84cb85a02;p=lhc%2Fweb%2Fwiklou.git (bug 7644) User creations that are aborted by hooks shouldn't be counted against account creations per day limit --- 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;