Lockdown not showing user groups

Jump to: navigation, search

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?

--141.20.192.102 12:02, 3 June 2011 (UTC)04:56, 6 June 2011

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,

Toniher 14:53, 9 June 2011 (UTC)14:53, 9 June 2011

It does :) Thank you!

141.20.192.6610:47, 10 June 2011
 

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'];
91.61.104.24120:47, 27 June 2011

This patch was added with r94275 Cheers

[[kgh]]21:29, 7 December 2011
 
 

Works on 1.17 as well, thanks for your effort

194.213.2.4015:02, 12 July 2011

It only works correctly with 1.17 in the case you have run the update.php after having replaced the corrected lockdown.php.

Feechen21:41, 5 August 2011
 
 
Personal tools

Variants
Actions
Navigation
Support
Download
Development
Communication
Toolbox