Index: trunk/extensions/AbuseFilter/AbuseFilter.php |
— | — | @@ -67,6 +67,7 @@ |
68 | 68 | $wgHooks['RecentChange_save'][] = 'AbuseFilterHooks::onRecentChangeSave'; |
69 | 69 | $wgHooks['ListDefinedTags'][] = 'AbuseFilterHooks::onListDefinedTags'; |
70 | 70 | $wgHooks['LoadExtensionSchemaUpdates'][] = 'AbuseFilterHooks::onLoadExtensionSchemaUpdates'; |
| 71 | +$wgHooks['ContributionsToolLinks'][] = 'AbuseFilterHooks::onContributionsToolLinks'; |
71 | 72 | |
72 | 73 | $wgAvailableRights[] = 'abusefilter-modify'; |
73 | 74 | $wgAvailableRights[] = 'abusefilter-log-detail'; |
Index: trunk/extensions/AbuseFilter/AbuseFilter.i18n.php |
— | — | @@ -95,7 +95,8 @@ |
96 | 96 | 'abusefilter-log-details-ip' => 'Originating IP address', |
97 | 97 | 'abusefilter-log-noactions' => 'none', |
98 | 98 | 'abusefilter-log-details-diff' => 'Changes made in edit', |
99 | | - |
| 99 | + 'abusefilter-log-linkoncontribs' => 'abuse log', |
| 100 | + 'abusefilter-log-linkoncontribs-text' => 'Abuse Log for this user', |
100 | 101 | // Abuse filter management |
101 | 102 | 'abusefilter-management' => 'Abuse filter management', |
102 | 103 | 'abusefilter-list' => 'All filters', |
Index: trunk/extensions/AbuseFilter/AbuseFilter.hooks.php |
— | — | @@ -181,4 +181,21 @@ |
182 | 182 | } |
183 | 183 | return true; |
184 | 184 | } |
| 185 | + |
| 186 | + public static function onContributionsToolLinks( $id, $nt, &$tools ) |
| 187 | + { |
| 188 | + global $wgUser; |
| 189 | + wfLoadExtensionMessages( 'AbuseFilter' ); |
| 190 | + if( $wgUser->isAllowed( 'abusefilter-log' ) ) { |
| 191 | + $sk = $wgUser->getSkin(); |
| 192 | + $tools[] = $sk->link( |
| 193 | + SpecialPage::getTitleFor( 'AbuseLog' ), |
| 194 | + wfMsg( 'abusefilter-log-linkoncontribs' ), |
| 195 | + array( 'title' => |
| 196 | + wfMsgExt( 'abusefilter-log-linkoncontribs-text', 'parseinline' ) ), |
| 197 | + array( 'wpSearchUser' => $nt->getText() ) |
| 198 | + ); |
| 199 | + } |
| 200 | + return true; |
| 201 | + } |
185 | 202 | } |