r37671 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r37670‎ | r37671 | r37672 >
Date:22:33, 14 July 2008
Author:demon
Status:old
Tags:
Comment:
(bug 14797), add Checkuser link to Contributions links. Patch by Nakon.
Modified paths:
  • /trunk/extensions/CheckUser/CheckUser.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CheckUser/CheckUser.php
@@ -1,4 +1,4 @@
2 -<?php
 2+<?PHP
33
44 # Not a valid entry point, skip unless MEDIAWIKI is defined
55 if (!defined('MEDIAWIKI')) {
@@ -34,6 +34,7 @@
3535 $wgHooks['RecentChange_save'][] = 'efUpdateCheckUserData';
3636 $wgHooks['ParserTestTables'][] = 'efCheckUserParserTestTables';
3737 $wgHooks['LoadExtensionSchemaUpdates'][] = 'efCheckUserSchemaUpdates';
 38+$wgHooks['ContributionsToolLinks'][] = 'wfLoadContribsLink';
3839
3940 /**
4041 * Hook function for RecentChange_save
@@ -215,3 +216,16 @@
216217 $wgSpecialPages['CheckUser'] = 'CheckUser';
217218 $wgSpecialPageGroups['CheckUser'] = 'users';
218219 $wgAutoloadClasses['CheckUser'] = dirname(__FILE__) . '/CheckUser_body.php';
 220+
 221+
 222+function wfLoadContribsLink( $id, $nt, &$links ) {
 223+ global $wgUser;
 224+ if( $wgUser->isAllowed( 'checkuser' ) ) {
 225+ wfLoadExtensionMessages( 'CheckUser' );
 226+ $links[] = $wgUser->getSkin()->makeKnownLinkObj(
 227+ SpecialPage::getTitleFor( 'CheckUser' ),
 228+ wfMsgHtml( 'checkuser' ),'user='.$nt->getDbKey()
 229+ );
 230+ }
 231+ return true;
 232+}

Follow-up revisions

RevisionCommit summaryAuthorDate
r37716Cleanup from r37671 "(bug 14797), add Checkuser link to Contributions links. ...brion21:24, 15 July 2008

Status & tagging log