(bug 7644) User creations that are aborted by hooks shouldn't be counted against...
authorAryeh Gregor <simetrical@users.mediawiki.org>
Fri, 20 Oct 2006 20:10:26 +0000 (20:10 +0000)
committerAryeh Gregor <simetrical@users.mediawiki.org>
Fri, 20 Oct 2006 20:10:26 +0000 (20:10 +0000)
RELEASE-NOTES
includes/SpecialUserlogin.php

index cb61fc3..e9400a4 100644 (file)
@@ -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 ==
 
index 150b88f..264ae14 100644 (file)
@@ -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;