r56318 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r56317‎ | r56318 | r56319 >
Date:18:11, 14 September 2009
Author:mrzman
Status:ok
Tags:
Comment:
Use the new ShowMissingArticle hook (r56317) to show the rename log on userpages of non-existent users
Modified paths:
  • /trunk/extensions/Renameuser/SpecialRenameuser.i18n.php (modified) (history)
  • /trunk/extensions/Renameuser/SpecialRenameuser.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Renameuser/SpecialRenameuser.i18n.php
@@ -40,6 +40,9 @@
4141 'renameuser-move-log' => 'Automatically moved page while renaming the user "[[User:$1|$1]]" to "[[User:$2|$2]]"',
4242
4343 'right-renameuser' => 'Rename users',
 44+
 45+ 'renamed-notice' => 'This user has been renamed.
 46+The rename log is provided below for reference.',
4447 );
4548
4649 /** Message documentation (Message documentation)
Index: trunk/extensions/Renameuser/SpecialRenameuser.php
@@ -61,3 +61,16 @@
6262 $wgSpecialPages['Renameuser'] = 'SpecialRenameuser';
6363 $wgSpecialPageGroups['Renameuser'] = 'users';
6464 $wgJobClasses['renameUser'] = 'RenameUserJob';
 65+
 66+$wgHooks['ShowMissingArticle'][] = 'wfRenameUserShowLog';
 67+
 68+function wfRenameUserShowLog( $article ) {
 69+ global $wgOut;
 70+ $title = $article->getTitle();
 71+ if ( $title->getNamespace() == NS_USER || $title->getNamespace() == NS_USER_TALK ) {
 72+ $page = $title->getPrefixedDBkey();
 73+ LogEventsList::showLogExtract( $wgOut, 'renameuser', $page, '', 10, array(), false, 'renamed-notice' );
 74+ }
 75+ return true;
 76+}
 77+

Follow-up revisions

RevisionCommit summaryAuthorDate
r56319Prefix message key with extension name (follow-up to r56318)siebrand18:15, 14 September 2009
r56321fix for r56318, make it work in user talk pages and subpages as wellmrzman18:21, 14 September 2009
r56422Follow-up on r56420 and r56318: adjust SpecialRenameuser to fit to new LogEve...churchofemacs18:00, 16 September 2009

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r56317Replace the user rename log display for non-existent userpages with a hook (f...mrzman18:10, 14 September 2009

Status & tagging log