Created
August 15, 2013 21:24
-
-
Save victorskl/6245051 to your computer and use it in GitHub Desktop.
Making Mediawiki SpecialPages only viewable by admin.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Making Mediawiki SpecialPages only viewable by admin. | |
Copy and paste this to end of LocalSettings.php | |
*/ | |
function disableSomeSpecialPages(&$list) { | |
global $wgUser; | |
if(!$wgUser->isAllowed('editinterface')) { | |
//remove some | |
#unset($list['Version']); | |
//remove exhaust list | |
foreach(array( | |
'Mostlinkedcategories', | |
'Export', | |
'Uncategorizedtemplates', | |
'Listredirects', | |
'DoubleRedirects', | |
'DeletedContributions', | |
'Mostcategories', | |
'Search', | |
'Block', | |
'Movepage', | |
'Mostrevisions', | |
'Unusedimages', | |
'Log', | |
'Mostlinkedtemplates', | |
'Deadendpages', | |
'JavaScriptTest', | |
'Userrights', | |
'Import', | |
'Ancientpages', | |
'Uncategorizedcategories', | |
'Activeusers', | |
'MergeHistory', | |
'Recentchanges', | |
'Randompage', | |
'Protectedpages', | |
'Wantedfiles', | |
'Listgrouprights', | |
'EditWatchlist', | |
'Blockme', | |
'FileDuplicateSearch', | |
'Withoutinterwiki', | |
'Randomredirect', | |
'BlockList', | |
'Popularpages', | |
'Emailuser', | |
'Booksources', | |
'Upload', | |
'Confirmemail', | |
'Watchlist', | |
'MIMEsearch', | |
'Allpages', | |
'Fewestrevisions', | |
'Unblock', | |
'ComparePages', | |
'Uncategorizedimages', | |
'Mostinterwikis', | |
'Preferences', | |
'Categories', | |
'Statistics', | |
'Version', | |
'UploadStash', | |
'Undelete', | |
'Whatlinkshere', | |
'Lockdb', | |
'Lonelypages', | |
'Mostimages', | |
'Unwatchedpages', | |
'Shortpages', | |
'Protectedtitles', | |
'Revisiondelete', | |
'Newpages', | |
'Unusedtemplates', | |
'Allmessages', | |
'CachedPage', | |
'Filepath', | |
'ChangePassword', | |
'Wantedpages', | |
'LinkSearch', | |
'Prefixindex', | |
'Recentchangeslinked', | |
'BrokenRedirects', | |
'Mostlinked', | |
'Tags', | |
'ChangeEmail', | |
'Longpages', | |
'Uncategorizedpages', | |
'Newimages', | |
'Blankpage', | |
'Disambiguations', | |
'Unusedcategories', | |
'Wantedcategories', | |
'PasswordReset', | |
'Unlockdb', | |
'PagesWithProp', | |
'Specialpages', | |
'Listfiles', | |
'Contributions', | |
'Listusers', | |
'Wantedtemplates' | |
)as $i){unset($list[$i]);} | |
} | |
return true; | |
} | |
$wgHooks['SpecialPage_initList'][]='disableSomeSpecialPages'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment