Thread:Extension talk:Lockdown/Problems with MediaWiki 1.16.5

I've installed a new MediaWiki sing 1.16.5, where anonymous users do not have the right to edit pages. When I enabled the Lockdown extension, without any further Lockdown config, the edit tab is removed for all logged in users.

Tracing the code the lockdownUserCan is only called for the read action for logged in users and no further and then lockdownSearchableNamespaces is called twice when loading a page. Disabling the lockdownSearchableNamespaces hook makes the problem go away so I investigated further down this way. It turns out that changing $ugroups = $wgUser->getEffectiveGroups; inside lockdownSearchableNamespaces to $ugroups = $wgUser->getEffectiveGroups(true); fixes this (this disables the cache for getEffectiveGroups).

With this change my MediaWiki installation works and now lockdownUserCan is called in addition for edit and move actions when loading a page (after the two calls to lockdownSearchableNamespaces).

I'm very new to MediaWiki, let alone the MediaWiki APIs, so I'm not sure if this is the correct fix or not or what is actually going on.

For reference the relevant permission related parts of LocalSettings.php are:

$wgGroupPermissions['*']['createaccount']   = false; $wgGroupPermissions['*']['edit']            = false; $wgGroupPermissions['*']['createpage']      = false; # 'createpage' requires the 'edit' right $wgGroupPermissions['*']['createtalk']      = false; # 'createtalk' requires the 'edit' right $wgGroupPermissions['*']['writeapi']        = false; $wgGroupPermissions['sysop']['suppressredirect'] = true; require_once( "$IP/extensions/Lockdown/Lockdown.php" );
 * 1) despite documented defaults administrators do not have 'suppressredirect' by default