r40119 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r40118‎ | r40119 | r40120 >
Date:03:36, 28 August 2008
Author:nad
Status:old
Tags:
Comment:
Die if MediaWiki version < 1.11
Modified paths:
  • /trunk/extensions/SimpleSecurity/SimpleSecurity.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SimpleSecurity/SimpleSecurity.php
@@ -16,9 +16,10 @@
1717 * @licence GNU General Public Licence 2.0 or later
1818 */
1919
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');
2122
22 -define('SIMPLESECURITY_VERSION', '4.2.6, 2008-08-28');
 23+define('SIMPLESECURITY_VERSION', '4.2.7, 2008-08-28');
2324
2425 # Global security settings
2526 $wgSecurityMagicIf = "ifusercan"; # the name for doing a permission-based conditional
@@ -70,8 +71,8 @@
7172 $wgSecurityRenderInfo, $wgSecurityAllowUnreadableLinks;
7273
7374 # $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;
7677
7778 # Add our parser-hooks
7879 $wgParser->setFunctionHook($wgSecurityMagicIf, array($this, 'ifUserCan'));
@@ -217,6 +218,7 @@
218219
219220 # Put the anon read right back in $wgGroupPermissions if it was there initially
220221 # - it had to be removed because Title::userCanRead short-circuits with it
 222+ print_r($rights);
221223 if ($this->default_read) {
222224 $wgGroupPermissions['*']['read'] = true;
223225 $rights[] = 'read';

Status & tagging log