r17135 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r17134‎ | r17135 | r17136 >
Date:20:10, 20 October 2006
Author:simetrical
Status:old
Tags:
Comment:
(bug 7644) User creations that are aborted by hooks shouldn't be counted against account creations per day limit
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/SpecialUserlogin.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/SpecialUserlogin.php
@@ -157,12 +157,12 @@
158158 global $wgLoginLanguageSelector;
159159 if( $wgLoginLanguageSelector && $this->mLanguage )
160160 $u->setOption( 'language', $this->mLanguage );
161 -
 161+
162162 # Save user settings and send out an email authentication message if needed
163163 $u->saveSettings();
164164 if( $wgEmailAuthentication && User::isValidEmailAddr( $u->getEmail() ) )
165165 $u->sendConfirmationMail();
166 -
 166+
167167 # If not logged in, assume the new account as the current one and set session cookies
168168 # then show a "welcome" message or a "need cookies" message as needed
169169 if( $wgUser->isAnon() ) {
@@ -257,6 +257,14 @@
258258 return false;
259259 }
260260
 261+ $abortError = '';
 262+ if( !wfRunHooks( 'AbortNewAccount', array( $u, &$abortError ) ) ) {
 263+ // Hook point to add extra creation throttles and blocks
 264+ wfDebug( "LoginForm::addNewAccountInternal: a hook blocked creation\n" );
 265+ $this->mainLoginForm( $abortError );
 266+ return false;
 267+ }
 268+
261269 if ( $wgAccountCreationThrottle ) {
262270 $key = wfMemcKey( 'acctcreate', 'ip', $ip );
263271 $value = $wgMemc->incr( $key );
@@ -269,14 +277,6 @@
270278 }
271279 }
272280
273 - $abortError = '';
274 - if( !wfRunHooks( 'AbortNewAccount', array( $u, &$abortError ) ) ) {
275 - // Hook point to add extra creation throttles and blocks
276 - wfDebug( "LoginForm::addNewAccountInternal: a hook blocked creation\n" );
277 - $this->mainLoginForm( $abortError );
278 - return false;
279 - }
280 -
281281 if( !$wgAuth->addUser( $u, $this->mPassword ) ) {
282282 $this->mainLoginForm( wfMsg( 'externaldberror' ) );
283283 return false;
Index: trunk/phase3/RELEASE-NOTES
@@ -63,6 +63,8 @@
6464 styling
6565 * (bug 6276) Stopped search field from getting too large in Cologne Blue
6666 * Fixed duplicate name/id value of "search" in Cologne Blue
 67+* (bug 7644) User creations that are aborted by hooks shouldn't be counted
 68+ against account creations per day limit
6769
6870 == Languages updated ==
6971