How to: hide wikimedia special pages from anonymous users (my way)

From Tronche's wiki
Jump to: navigation, search

This is a quick and dirty hack tested with wikimedia 1.20. In includes/SkinTemplate.php, locate the buildNavUrls function.

At the beginning of the function, add:

global $wgUser;

Then locate the line:

$nav_urls['specialpages'] = array( 'href' => self::makeSpecialUrl( 'Specialpages' ));

Change that into:

if (!$wgUser->isAnon()) {
 $nav_urls['specialpages'] = array( 'href' => self::makeSpecialUrl( 'Specialpages' ));
}

NB: the cache may get in your way, so test on new pages or clear your browser cache first.


Add your comment
Tronche's wiki welcomes all comments. If you do not want to be anonymous, register or log in. It is free.

Personal tools