http://www.mediawiki.org/wiki/Special:Code/MediaWiki/90946
Revision: 90946
Author: nad
Date: 2011-06-28 08:33:14 +0000 (Tue, 28 Jun 2011)
Log Message:
-----------
remove the legacy defaultread hack as it fails on recent MediaWiki version
Modified Paths:
--------------
trunk/extensions/SimpleSecurity/SimpleSecurity.php
trunk/extensions/SimpleSecurity/SimpleSecurity_body.php
Modified: trunk/extensions/SimpleSecurity/SimpleSecurity.php
===================================================================
--- trunk/extensions/SimpleSecurity/SimpleSecurity.php 2011-06-28 07:15:01 UTC
(rev 90945)
+++ trunk/extensions/SimpleSecurity/SimpleSecurity.php 2011-06-28 08:33:14 UTC
(rev 90946)
@@ -22,7 +22,7 @@
* @copyright © 2007-2011 Aran Dunkley
* @license GNU General Public Licence 2.0 or later
*/
-define( 'SIMPLESECURITY_VERSION', '5.0.1, 2011-06-25' );
+define( 'SIMPLESECURITY_VERSION', '5.0.3, 2011-06-28' );
# Load the SimpleSecurity class and messages
$dir = dirname( __FILE__ ) . '/';
Modified: trunk/extensions/SimpleSecurity/SimpleSecurity_body.php
===================================================================
--- trunk/extensions/SimpleSecurity/SimpleSecurity_body.php 2011-06-28
07:15:01 UTC (rev 90945)
+++ trunk/extensions/SimpleSecurity/SimpleSecurity_body.php 2011-06-28
08:33:14 UTC (rev 90946)
@@ -26,10 +26,6 @@
$wgRestrictionTypes, $wgRestrictionLevels,
$wgGroupPermissions,
$wgSecurityRenderInfo, $wgSecurityAllowUnreadableLinks,
$wgSecurityGroupsArticle;
- # $wgGroupPermissions has to have its default read entry
removed because Title::userCanRead checks it directly
- if ( $this->default_read = ( isset(
$wgGroupPermissions['*']['read'] ) && $wgGroupPermissions['*']['read'] ) )
- $wgGroupPermissions['*']['read'] = false;
-
# Add our hooks
$wgHooks['UserGetRights'][] = $this;
$wgHooks['ImgAuthBeforeStream'][] = $this;
@@ -170,14 +166,8 @@
* Check if image is accessible by current user when using img_auth
*/
public function onImgAuthBeforeStream( &$title, &$path, &$name,
&$result ) {
- global $wgUser, $wgGroupPermissions;
+ global $wgUser;
- # Put the anon read right back in $wgGroupPermissions if it was
there initially
- # - it had to be removed because Title::userCanRead
short-circuits with it
- if ( $this->default_read ) {
- $wgGroupPermissions['*']['read'] = true;
- }
-
if ( !$this->userCanReadTitle( $wgUser, $title, $error )) {
$result = array('img-auth-accessdenied',
'img-auth-noread', $name);
return false;
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs