http://www.mediawiki.org/wiki/Special:Code/MediaWiki/73376
Revision: 73376
Author: churchofemacs
Date: 2010-09-20 14:29:52 +0000 (Mon, 20 Sep 2010)
Log Message:
-----------
don't display renameuserlog on pages of usurped accounts. Thanks to Chzz for
this idea
Modified Paths:
--------------
trunk/extensions/Renameuser/Renameuser.php
Modified: trunk/extensions/Renameuser/Renameuser.php
===================================================================
--- trunk/extensions/Renameuser/Renameuser.php 2010-09-20 13:35:51 UTC (rev
73375)
+++ trunk/extensions/Renameuser/Renameuser.php 2010-09-20 14:29:52 UTC (rev
73376)
@@ -64,10 +64,15 @@
$wgHooks['ShowMissingArticle'][] = 'wfRenameUserShowLog';
$wgHooks['ContributionsToolLinks'][] = 'wfRenameuserOnContribsLink';
+/**
+ * Show a log if the user has been renamed and point to the new username.
+ * Don't show the log if the $oldUserName exists as a user.
+ */
function wfRenameUserShowLog( $article ) {
global $wgOut;
$title = $article->getTitle();
- if ( $title->getNamespace() == NS_USER || $title->getNamespace() ==
NS_USER_TALK ) {
+ $oldUserName = User::newFromName( $title->getBaseText() );
+ if ( ($title->getNamespace() == NS_USER || $title->getNamespace() ==
NS_USER_TALK ) && $oldUserName->getId()==0) {
// Get the title for the base userpage
$page = Title::makeTitle( NS_USER, str_replace( ' ', '_',
$title->getBaseText() ) )->getPrefixedDBkey();
LogEventsList::showLogExtract( $wgOut, 'renameuser', $page, '',
array( 'lim' => 10, 'showIfEmpty' => false,
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs