r53407 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r53406‎ | r53407 | r53408 >
Date:16:59, 17 July 2009
Author:werdna
Status:deferred (Comments)
Tags:
Comment:
Don't show navigation links (import, tools) where the user has no rights to view them. Fixes bug 19714.
Modified paths:
  • /trunk/extensions/AbuseFilter/AbuseFilter.class.php (modified) (history)

Diff [purge]

Index: trunk/extensions/AbuseFilter/AbuseFilter.class.php
@@ -118,16 +118,21 @@
119119 );
120120
121121 public static function addNavigationLinks( $out, $sk, $pageType ) {
122 - global $wgLang;
 122+ global $wgLang, $wgUser;
123123 $linkDefs = array(
124124 'home' => 'Special:AbuseFilter',
125125 'recentchanges' => 'Special:AbuseFilter/history',
126126 'test' => 'Special:AbuseFilter/test',
127127 'examine' => 'Special:AbuseFilter/examine',
128128 'log' => 'Special:AbuseLog',
 129+ );
 130+
 131+ if ($wgUser->isAllowed( 'abusefilter-modify' ) ) {
 132+ $linkDefs = array_merge( $linkDefs, array(
129133 'tools' => 'Special:AbuseFilter/tools',
130134 'import' => 'Special:AbuseFilter/import',
131 - );
 135+ ) );
 136+ }
132137
133138 // Save some translator work
134139 $msgOverrides = array(

Comments

#Comment by Umherirrender (talk | contribs)   18:59, 23 July 2009

Maybe the same for:

  • 'test'
  • 'log' (right 'abusefilter-log')

I do not know, which right is necessary for the other specialpages.

Status & tagging log