r58193 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r58192‎ | r58193 | r58194 >
Date:14:10, 27 October 2009
Author:raymond
Status:ok
Tags:
Comment:
Use the new hook from r58192: Create a link to the GlobalBlockLog
Modified paths:
  • /trunk/extensions/GlobalBlocking/GlobalBlocking.class.php (modified) (history)
  • /trunk/extensions/GlobalBlocking/GlobalBlocking.i18n.php (modified) (history)
  • /trunk/extensions/GlobalBlocking/GlobalBlocking.php (modified) (history)

Diff [purge]

Index: trunk/extensions/GlobalBlocking/GlobalBlocking.php
@@ -29,6 +29,7 @@
3030 $wgHooks['getUserPermissionsErrorsExpensive'][] = 'GlobalBlocking::getUserPermissionsErrors';
3131 $wgHooks['UserIsBlockedGlobally'][] = 'GlobalBlocking::isBlockedGlobally';
3232 $wgHooks['UserLoginMailPassword'][] = 'GlobalBlocking::onMailPassword';
 33+$wgHooks['getOtherBlockLogLink'][] = 'GlobalBlocking::getBlockLogLink';
3334
3435 $wgAutoloadClasses['SpecialGlobalBlock'] = "$dir/SpecialGlobalBlock.php";
3536 $wgSpecialPages['GlobalBlock'] = 'SpecialGlobalBlock';
Index: trunk/extensions/GlobalBlocking/GlobalBlocking.class.php
@@ -279,4 +279,25 @@
280280 }
281281 return true;
282282 }
 283+
 284+ /**
 285+ * Creates a link to the global block log
 286+ * @param array $msg Message with a link to the global block log
 287+ * @param string $ip The IP address to be checked
 288+ * @return boolean true
 289+ */
 290+ static function getBlockLogLink( &$msg, $ip ) {
 291+ # IP addresses can be blocked only.
 292+ if ( !IP::isIPAddress( $ip ) ) {
 293+ return true;
 294+ }
 295+
 296+ wfLoadExtensionMessages( 'GlobalBlocking' );
 297+ $msg[] = Html::rawElement(
 298+ 'span',
 299+ array( 'class' => 'mw-globalblock-loglink plainlinks' ),
 300+ wfMsgExt( 'globalblocking-loglink', 'parseinline', $ip )
 301+ );
 302+ return true;
 303+ }
283304 }
Index: trunk/extensions/GlobalBlocking/GlobalBlocking.i18n.php
@@ -110,6 +110,7 @@
111111 'globalblocking-modify-logentry' => 'modified the global block on [[$1]] ($2)',
112112 'globalblocking-logentry-expiry' => 'expires $1',
113113 'globalblocking-logentry-noexpiry' => 'no expiry set',
 114+ 'globalblocking-loglink' => 'Check the global block status of the IP address [{{fullurl:{{#Special:GlobalBlockList}}|ip=$1}} "$1"].',
114115
115116 'globalblocklist' => 'List of globally blocked IP addresses',
116117 'globalblock' => 'Globally block an IP address',

Follow-up revisions

RevisionCommit summaryAuthorDate
r58207Follow-up r58193: Make the link nicer (related to r58206)raymond19:09, 27 October 2009
r58281Improvement to r58193: Hook checks for existence of a global block now.raymond19:57, 28 October 2009

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r58192New hook getOtherBlockLogLink, called in Special:IPBlockList to show links to...raymond14:08, 27 October 2009

Status & tagging log