r48722 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r48721‎ | r48722 | r48723 >
Date:23:14, 23 March 2009
Author:brion
Status:ok
Tags:
Comment:
Change order of operations a bit in autologin local user creation to minimize the chance that things won't get logged:
* Moved log save up to right after the account creation
* Moved site_stats update to bottom, below hook call [CheckUser log]; being a single row contention is most likely here.
Modified paths:
  • /trunk/extensions/CentralAuth/CentralAuthHooks.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CentralAuth/CentralAuthHooks.php
@@ -415,17 +415,18 @@
416416 wfDebug( __METHOD__.": creating new user\n" );
417417 $user->loadDefaults( $userName );
418418 $user->addToDatabase();
 419+ $user->addNewUserLogEntryAutoCreate();
419420
420421 $wgAuth->initUser( $user, true );
421422 $wgAuth->updateUser( $user );
422423
 424+ # Notify hooks (e.g. Newuserlog)
 425+ wfRunHooks( 'AuthPluginAutoCreate', array( $user ) );
 426+
423427 # Update user count
424428 $ssUpdate = new SiteStatsUpdate( 0, 0, 0, 0, 1 );
425429 $ssUpdate->doUpdate();
426 -
427 - # Notify hooks (e.g. Newuserlog)
428 - wfRunHooks( 'AuthPluginAutoCreate', array( $user ) );
429 - $user->addNewUserLogEntryAutoCreate();
 430+
430431 return true;
431432 }
432433

Status & tagging log