Lockdown not showing user groups
I have some strange behavior with lockdown (1.16-r70092) using MW 1.16.5. When I write 'require_once("$IP/extensions/Lockdown/Lockdown.php");' to my LocalSettings.php the Special:Preferences page won't show my user groups anymore (even though they are displayed in the groups List (Special:ListUsers&group=bureaucrat)). I would not mind that, but it also deletes my userrights-permission (i.e. no access to Special:UserRights), so I can't setup the Lockdown Extension properly. Is there any way to work around that?
Hi, I also had that problem and I solved it by following the same instructions as below.
I simply changed all getEffectiveGroups() to getEffectiveGroups(true).
Hope this helps,
The complete patch to apply to the version of Lockdown from 1_17_0 svn-tree:
--- svn-extensions/Lockdown/Lockdown.php 2011-06-27 19:53:38.000000000 +0000
+++ man-extensions/Lockdown-patched/Lockdown.php 2011-06-27 20:26:20.000000000 +0000
@@ -96,7 +96,7 @@
# print "<br />nsAccessUserCan(".$title->getPrefixedDBkey().", ".$user->getName().", $action)<br />\n";
# print_r($groups);
- $ugroups = $user->getEffectiveGroups();
+ $ugroups = $user->getEffectiveGroups(true);
# print_r($ugroups);
$match = array_intersect( $ugroups, $groups );
@@ -127,7 +127,7 @@
if ( $groups === null ) return true;
if ( count( $groups ) == 0 ) return false;
- $ugroups = $user->getEffectiveGroups();
+ $ugroups = $user->getEffectiveGroups(true);
$match = array_intersect( $ugroups, $groups );
if ( $match ) return true;
@@ -136,7 +136,7 @@
function lockdownSearchableNamespaces($arr) {
global $wgUser, $wgNamespacePermissionLockdown;
- $ugroups = $wgUser->getEffectiveGroups();
+ $ugroups = $wgUser->getEffectiveGroups(true);
foreach ( $arr as $ns => $name ) {
$groups = @$wgNamespacePermissionLockdown[$ns]['read'];
@@ -155,7 +155,7 @@
function lockdownTitle(&$title) {
if ( is_object($title) ) {
global $wgUser, $wgNamespacePermissionLockdown;
- $ugroups = $wgUser->getEffectiveGroups();
+ $ugroups = $wgUser->getEffectiveGroups(true);
$groups = @$wgNamespacePermissionLockdown[$title->getNamespace()]['read'];
if ( $groups === NULL ) $groups = @$wgNamespacePermissionLockdown['*']['read'];
@@ -184,7 +184,7 @@
return true;
}
- $ugroups = $wgUser->getEffectiveGroups();
+ $ugroups = $wgUser->getEffectiveGroups(true);
foreach ( $searchEngine->namespaces as $key => $ns ) {
$groups = @$wgNamespacePermissionLockdown[$ns]['read'];
Works on 1.17 as well, thanks for your effort