r32816 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r32815‎ | r32816 | r32817 >
Date:16:44, 5 April 2008
Author:aaron
Status:old
Tags:
Comment:
Rename block/rights log (bug 7011)
Modified paths:
  • /trunk/extensions/Renameuser/SpecialRenameuser_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Renameuser/SpecialRenameuser_body.php
@@ -362,11 +362,23 @@
363363 array( 'user_name' => $this->old ),
364364 __METHOD__
365365 );
366 - // Update ipblock list name.
 366+ // Update ipblock list if this user has a block in there.
367367 $dbw->update( 'ipblocks',
368368 array( 'ipb_address' => $this->new ),
369369 array( 'ipb_user' => $this->uid, 'ipb_address' => $this->old ),
370370 __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' ) );
371383
372384 foreach( $this->tables as $table => $field ) {
373385 $dbw->update( $table,

Status & tagging log