Index: trunk/extensions/Renameuser/SpecialRenameuser_body.php |
— | — | @@ -362,11 +362,23 @@ |
363 | 363 | array( 'user_name' => $this->old ), |
364 | 364 | __METHOD__ |
365 | 365 | ); |
366 | | - // Update ipblock list name. |
| 366 | + // Update ipblock list if this user has a block in there. |
367 | 367 | $dbw->update( 'ipblocks', |
368 | 368 | array( 'ipb_address' => $this->new ), |
369 | 369 | array( 'ipb_user' => $this->uid, 'ipb_address' => $this->old ), |
370 | 370 | __METHOD__ ); |
| 371 | + // Update this users block/rights log. Ideally, the logs would be historical, |
| 372 | + // but it is really annoying when users have "clean" block logs by virtue of |
| 373 | + // being renamed, which makes admin tasks more of a pain... |
| 374 | + $oldTitle = Title::makeTitle( NS_USER, $this->old ); |
| 375 | + $newTitle = Title::makeTitle( NS_USER, $this->new ); |
| 376 | + $dbw->update( 'logging', |
| 377 | + array( 'log_title' => $newTitle->getDBKey() ), |
| 378 | + array( 'log_type' => array( 'block', 'rights' ), |
| 379 | + 'log_namespace' => NS_USER, |
| 380 | + 'log_title' => $oldTitle->getDBKey() ), |
| 381 | + __METHOD__, |
| 382 | + array( 'USE INDEX' => 'page_time' ) ); |
371 | 383 | |
372 | 384 | foreach( $this->tables as $table => $field ) { |
373 | 385 | $dbw->update( $table, |