Index: trunk/extensions/GlobalBlocking/GlobalBlocking.php |
— | — | @@ -29,6 +29,7 @@ |
30 | 30 | $wgHooks['getUserPermissionsErrorsExpensive'][] = 'GlobalBlocking::getUserPermissionsErrors'; |
31 | 31 | $wgHooks['UserIsBlockedGlobally'][] = 'GlobalBlocking::isBlockedGlobally'; |
32 | 32 | $wgHooks['UserLoginMailPassword'][] = 'GlobalBlocking::onMailPassword'; |
| 33 | +$wgHooks['getOtherBlockLogLink'][] = 'GlobalBlocking::getBlockLogLink'; |
33 | 34 | |
34 | 35 | $wgAutoloadClasses['SpecialGlobalBlock'] = "$dir/SpecialGlobalBlock.php"; |
35 | 36 | $wgSpecialPages['GlobalBlock'] = 'SpecialGlobalBlock'; |
Index: trunk/extensions/GlobalBlocking/GlobalBlocking.class.php |
— | — | @@ -279,4 +279,25 @@ |
280 | 280 | } |
281 | 281 | return true; |
282 | 282 | } |
| 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 | + } |
283 | 304 | } |
Index: trunk/extensions/GlobalBlocking/GlobalBlocking.i18n.php |
— | — | @@ -110,6 +110,7 @@ |
111 | 111 | 'globalblocking-modify-logentry' => 'modified the global block on [[$1]] ($2)', |
112 | 112 | 'globalblocking-logentry-expiry' => 'expires $1', |
113 | 113 | 'globalblocking-logentry-noexpiry' => 'no expiry set', |
| 114 | + 'globalblocking-loglink' => 'Check the global block status of the IP address [{{fullurl:{{#Special:GlobalBlockList}}|ip=$1}} "$1"].', |
114 | 115 | |
115 | 116 | 'globalblocklist' => 'List of globally blocked IP addresses', |
116 | 117 | 'globalblock' => 'Globally block an IP address', |