Author: eris.discordia
Description:
I was toying with a local installation of MediaWiki 1.6.7 trying to manage access rights
for anonymous users. In order to restrict access to all Special: pages (except Special:
Userlogin) I did as was told in:
http://meta.wikimedia.org/wiki/Preventing_Access#Preventing_access_to_some_SpecialPages
This worked. I set the $restriction parameter for all unrestricted pages (those without
'rollback', 'unwatchedpages', etc) to a custom 'useronly' and granted 'sysop' the
permission. Anonymous users could not access the pages anymore.
Later I noticed that Special:Specialpages has shrunken considerably and found out that
all special pages whose access restriction was something but the usual pre-defined values
would not show up in Special:Specialpages.
Tracing the problem I found in "includes/SpecialSpecialpages.php" the following code:
foreach($wgAvailableRights as $right) {
/** only show pages a user can access */ if( $wgUser->isAllowed($right) ) { /** some rights might not have any special page associated */ if(isset($pages[$right])) { $rpages = array_merge( $rpages, $pages[$right] ); } }
in function wfSpecialSpecialpages(). Checking on $wgAvailableRights in "includes/Defines.
php" I figured out that this (static) array obviously did not contain my custom
'useronly' or any other custom permissions. Since $right is enumerated against the
array's contents any restriced page with permissions other than those in the array would
not show in Special:Specialpages.
The function description/comment did include a line saying:
@todo Is this necessary?
So I guess this is going to be fixed but I am reporting it anyway to improve its chances
of getting fixed.
Thanks.
WAMP Config (unnecessary I believe, but anyway):
Windows XP Professional (no SP)
Apache HTTP Server v2.0.58
MySQL 5.0.22 Community Edition
PHP 5.1.4
Version: 1.6.x
Severity: trivial
OS: Windows XP
Platform: PC