r94275 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r94274‎ | r94275 | r94276 >
Date:19:39, 11 August 2011
Author:mah
Status:deferred (Comments)
Tags:
Comment:
fix bug #30275 “SearchableNamespaces hook removes robots permissions”

avoid cache when using getEffectiveGroups
Modified paths:
  • /trunk/extensions/Lockdown/Lockdown.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Lockdown/Lockdown.php
@@ -105,7 +105,7 @@
106106 # print "<br />nsAccessUserCan(".$title->getPrefixedDBkey().", ".$user->getName().", $action)<br />\n";
107107 # print_r($groups);
108108
109 - $ugroups = $user->getEffectiveGroups();
 109+ $ugroups = $user->getEffectiveGroups( true );;
110110 # print_r($ugroups);
111111
112112 $match = array_intersect( $ugroups, $groups );
@@ -141,7 +141,7 @@
142142 return false;
143143 }
144144
145 - $ugroups = $user->getEffectiveGroups();
 145+ $ugroups = $user->getEffectiveGroups( true );;
146146 $match = array_intersect( $ugroups, $groups );
147147
148148 if ( $match ) {
@@ -159,7 +159,7 @@
160160 return true;
161161 }
162162
163 - $ugroups = $wgUser->getEffectiveGroups();
 163+ $ugroups = $wgUser->getEffectiveGroups( true );;
164164
165165 foreach ( $arr as $ns => $name ) {
166166 $groups = @$wgNamespacePermissionLockdown[$ns]['read'];
@@ -184,7 +184,7 @@
185185 function lockdownTitle(&$title) {
186186 if ( is_object($title) ) {
187187 global $wgUser, $wgNamespacePermissionLockdown;
188 - $ugroups = $wgUser->getEffectiveGroups();
 188+ $ugroups = $wgUser->getEffectiveGroups( true );;
189189
190190 $groups = @$wgNamespacePermissionLockdown[$title->getNamespace()]['read'];
191191 if ( $groups === null ) {
@@ -219,7 +219,7 @@
220220 return true;
221221 }
222222
223 - $ugroups = $wgUser->getEffectiveGroups();
 223+ $ugroups = $wgUser->getEffectiveGroups( true );;
224224
225225 foreach ( $searchEngine->namespaces as $key => $ns ) {
226226 $groups = @$wgNamespacePermissionLockdown[$ns]['read'];

Comments

#Comment by Reedy (talk | contribs)   20:49, 11 August 2011

Why the double semi colons?

#Comment by Quis (talk | contribs)   23:23, 3 September 2011

This isn't a real fix to the problem. Please take a look at my analysis at Extension_talk:Lockdown#Problem_with_mw_1.17_6704.

Status & tagging log