r32240 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r32239‎ | r32240 | r32241 >
Date:18:40, 20 March 2008
Author:rotem
Status:old
Tags:
Comment:
Avoid a logic error in chooseHomeWiki when both wgCentralAuthAutoNew and wgCentralAuthAutoMigrate are on, and a new account is created when no other account named like this exists.
Modified paths:
  • /trunk/extensions/CentralAuth/CentralAuthUser.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CentralAuth/CentralAuthUser.php
@@ -448,6 +448,10 @@
449449 }
450450
451451 $migrationSet = $this->queryUnattached();
 452+ if( empty( $migrationSet ) ) {
 453+ wfDebugLog( 'CentralAuth', 'dry run: no accounts to merge, failed migration' );
 454+ return false;
 455+ }
452456 $home = $this->chooseHomeWiki( $migrationSet );
453457 $local = $migrationSet[$home];
454458
@@ -483,6 +487,10 @@
484488 */
485489 private function attemptAutoMigration( $passwords=array() ) {
486490 $migrationSet = $this->queryUnattached();
 491+ if( empty( $migrationSet ) ) {
 492+ wfDebugLog( 'CentralAuth', 'no accounts to merge, failed migration' );
 493+ return false;
 494+ }
487495
488496
489497 $this->mHomeWiki = $this->chooseHomeWiki( $migrationSet );

Status & tagging log