r40510 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r40509‎ | r40510 | r40511 >
Date:00:57, 6 September 2008
Author:nad
Status:old
Tags:
Comment:
Fix bug preventing extra groups from showing up in protection form in 1.13+
Modified paths:
  • /trunk/extensions/SimpleSecurity/SimpleSecurity.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SimpleSecurity/SimpleSecurity.php
@@ -21,7 +21,7 @@
2222 if (!defined('MEDIAWIKI')) die('Not an entry point.');
2323 if (version_compare($wgVersion, '1.11.0') < 0) die('Sorry, this extension requires at least MediaWiki version 1.11.0');
2424
25 -define('SIMPLESECURITY_VERSION', '4.2.11, 2008-09-05');
 25+define('SIMPLESECURITY_VERSION', '4.2.12, 2008-09-06');
2626
2727 # Global security settings
2828 $wgSecurityMagicIf = "ifusercan"; # the name for doing a permission-based conditional
@@ -102,11 +102,15 @@
103103 #$wgGroupPermissions['sysop'][$k] = true; # Ensure sysops have the right to perform this extra action
104104 }
105105
 106+ # Ensure the new groups show up in rights management
 107+ # - note that 1.13 does a strange check in the ProtectionForm::buildSelector
 108+ # $wgUser->isAllowed($key) where $key is an item from $wgRestrictionLevels
 109+ # this requires that we treat the extra groups as an action and make sure its allowed by the user
106110 foreach ($wgSecurityExtraGroups as $k => $v) {
107111 if (empty($v)) $v = ucfirst($k);
108112 $wgRestrictionLevels[] = $k;
109113 $wgMessageCache->addMessages(array( "protect-level-$k" => $v ));
110 - $wgGroupPermissions[$k]['not_an_action'] = true; # Ensure the new groups show up in rights management
 114+ $wgGroupPermissions[$k][$k] = true;
111115 }
112116 }
113117

Status & tagging log