Index: trunk/extensions/SimpleSecurity/SimpleSecurity.php |
— | — | @@ -16,9 +16,10 @@ |
17 | 17 | * @licence GNU General Public Licence 2.0 or later |
18 | 18 | */ |
19 | 19 | |
20 | | -if (!defined('MEDIAWIKI')) die('Not an entry point.'); |
| 20 | +if (!defined('MEDIAWIKI')) die('Not an entry point.'); |
| 21 | +if (version_compare($wgVersion, '1.11.0') < 0) die('Sorry, this extension requires at least MediaWiki version 1.11.0'); |
21 | 22 | |
22 | | -define('SIMPLESECURITY_VERSION', '4.2.6, 2008-08-28'); |
| 23 | +define('SIMPLESECURITY_VERSION', '4.2.7, 2008-08-28'); |
23 | 24 | |
24 | 25 | # Global security settings |
25 | 26 | $wgSecurityMagicIf = "ifusercan"; # the name for doing a permission-based conditional |
— | — | @@ -70,8 +71,8 @@ |
71 | 72 | $wgSecurityRenderInfo, $wgSecurityAllowUnreadableLinks; |
72 | 73 | |
73 | 74 | # $wgGroupPermissions has to have its default read entry removed because Title::userCanRead checks it directly |
74 | | - if ($this->default_read = (isset($wgGroupPermissions['*']['read']) && $wgGroupPermissions['*']['read'])) |
75 | | - $wgGroupPermissions['*']['read'] = false; |
| 75 | + #if ($this->default_read = (isset($wgGroupPermissions['*']['read']) && $wgGroupPermissions['*']['read'])) |
| 76 | + # $wgGroupPermissions['*']['read'] = false; |
76 | 77 | |
77 | 78 | # Add our parser-hooks |
78 | 79 | $wgParser->setFunctionHook($wgSecurityMagicIf, array($this, 'ifUserCan')); |
— | — | @@ -217,6 +218,7 @@ |
218 | 219 | |
219 | 220 | # Put the anon read right back in $wgGroupPermissions if it was there initially |
220 | 221 | # - it had to be removed because Title::userCanRead short-circuits with it |
| 222 | + print_r($rights); |
221 | 223 | if ($this->default_read) { |
222 | 224 | $wgGroupPermissions['*']['read'] = true; |
223 | 225 | $rights[] = 'read'; |