Index: trunk/extensions/Renameuser/Renameuser.php |
— | — | @@ -64,10 +64,15 @@ |
65 | 65 | $wgHooks['ShowMissingArticle'][] = 'wfRenameUserShowLog'; |
66 | 66 | $wgHooks['ContributionsToolLinks'][] = 'wfRenameuserOnContribsLink'; |
67 | 67 | |
| 68 | +/** |
| 69 | + * Show a log if the user has been renamed and point to the new username. |
| 70 | + * Don't show the log if the $oldUserName exists as a user. |
| 71 | + */ |
68 | 72 | function wfRenameUserShowLog( $article ) { |
69 | 73 | global $wgOut; |
70 | 74 | $title = $article->getTitle(); |
71 | | - if ( $title->getNamespace() == NS_USER || $title->getNamespace() == NS_USER_TALK ) { |
| 75 | + $oldUserName = User::newFromName( $title->getBaseText() ); |
| 76 | + if ( ($title->getNamespace() == NS_USER || $title->getNamespace() == NS_USER_TALK ) && $oldUserName->getId()==0) { |
72 | 77 | // Get the title for the base userpage |
73 | 78 | $page = Title::makeTitle( NS_USER, str_replace( ' ', '_', $title->getBaseText() ) )->getPrefixedDBkey(); |
74 | 79 | LogEventsList::showLogExtract( $wgOut, 'renameuser', $page, '', array( 'lim' => 10, 'showIfEmpty' => false, |