Topic on Extension talk:Lockdown

Can't Block Special Namespace

3
121.200.34.78 (talkcontribs)

I've installed Lockdown to restrict the special namespace to sysop and cm user groups, but when testing it, it doesn't seem to work.


My LocalSettings.php contains the following:

wfLoadExtension( 'Lockdown' );

$wgNamespacePermissionLockdown[NS_SPECIAL]['*'] = [ 'sysop', 'cm' ];


Any advise? Thanks

Narcisgarcia (talkcontribs)

Same here.

Tried:

$wgNamespacePermissionLockdown[NS_SPECIAL]['*'] = [ 'user' ];

Perhaps is there some way to do a loop to every special page (from what array?) and set $wgSpecialPageLockdown for them.

Narcisgarcia (talkcontribs)

This works for me to make special pages disappear to anonymous users:

$wgHooks['SpecialPage_initList'][] = function ( &$list ) {
	$PagesWhiteList = array('Userlogin', 'PasswordReset', 'Categories', 'Tags', 'Search', 'Captcha');
	foreach ($list as $PageName => $PageSpecs) {
		if (!in_array($PageName, $PagesWhiteList) && RequestContext::getMain()->getUser()->isAnon()) {
			unset( $list[$PageName] );
		}
	}
	return true;
};
Reply to "Can't Block Special Namespace"