r16819 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r16818‎ | r16819 | r16820 >
Date:22:44, 5 October 2006
Author:brion
Status:old
Tags:
Comment:
tweaky
Modified paths:
  • /trunk/extensions/CentralAuth/TestPlugin.php (modified) (history)
  • /trunk/extensions/CentralAuth/migratePass0.php (modified) (history)
  • /trunk/extensions/CentralAuth/migratePass1.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CentralAuth/TestPlugin.php
@@ -230,6 +230,12 @@
231231 function attemptAutoMigration( $password='' ) {
232232 $rows = $this->fetchUnattached();
233233
 234+ if( !$rows ) {
 235+ wfDebugLog( 'CentralAuth',
 236+ "Attempted migration with no unattahced for '$this->mName'" );
 237+ return false;
 238+ }
 239+
234240 $winner = false;
235241 $max = -1;
236242 $attach = array();
@@ -503,6 +509,7 @@
504510 'lu_attached' => 0,
505511 ),
506512 __METHOD__ );
 513+ $rows = array();
507514 while( $row = $dbw->fetchObject( $result ) ) {
508515 $rows[] = $row;
509516 }
Index: trunk/extensions/CentralAuth/migratePass0.php
@@ -6,7 +6,7 @@
77 // * generate 'globaluser' entries for each username
88 // --> enable
99
10 -require_once 'commandLine.inc';
 10+require '../../maintenance/commandLine.inc';
1111
1212
1313 /**
Index: trunk/extensions/CentralAuth/migratePass1.php
@@ -3,7 +3,7 @@
44 // pass 1: go through all usernames in 'localuser' and create 'globaluser' rows
55 // for those that can be automatically migrated, go ahead and do it.
66
7 -require_once 'commandLine.inc';
 7+require '../../maintenance/commandLine.inc';
88
99 function migratePassOne() {
1010 $dbBackground = wfGetDB( DB_SLAVE, 'CentralAuth' ); // fixme for large dbs