Index: trunk/phase3/includes/User.php |
— | — | @@ -1770,16 +1770,9 @@ |
1771 | 1771 | * @return boolean True: action is allowed, False: action should not be allowed |
1772 | 1772 | */ |
1773 | 1773 | function isAllowed($action='') { |
1774 | | - global $wgGroupPermissions; |
1775 | | - if( $action === '' ) { |
| 1774 | + if ( $action === '' ) |
1776 | 1775 | // In the spirit of DWIM |
1777 | 1776 | return true; |
1778 | | - } |
1779 | | - if( !empty( $wgGroupPermissions['*'][$action] ) ) { |
1780 | | - # Permissions are additive, so there's no need to unstub the User |
1781 | | - # object in this case. |
1782 | | - return true; |
1783 | | - } |
1784 | 1777 | |
1785 | 1778 | return in_array( $action, $this->getRights() ); |
1786 | 1779 | } |
Index: trunk/phase3/includes/Title.php |
— | — | @@ -1387,7 +1387,7 @@ |
1388 | 1388 | * @todo fold these checks into userCan() |
1389 | 1389 | */ |
1390 | 1390 | public function userCanRead() { |
1391 | | - global $wgUser; |
| 1391 | + global $wgUser, $wgGroupPermissions; |
1392 | 1392 | |
1393 | 1393 | $result = null; |
1394 | 1394 | wfRunHooks( 'userCan', array( &$this, &$wgUser, 'read', &$result ) ); |
— | — | @@ -1395,6 +1395,10 @@ |
1396 | 1396 | return $result; |
1397 | 1397 | } |
1398 | 1398 | |
| 1399 | + # Shortcut for public wikis, allows skipping quite a bit of code |
| 1400 | + if ($wgGroupPermissions['*']['read']) |
| 1401 | + return true; |
| 1402 | + |
1399 | 1403 | if( $wgUser->isAllowed( 'read' ) ) { |
1400 | 1404 | return true; |
1401 | 1405 | } else { |
Index: trunk/phase3/includes/Namespace.php |
— | — | @@ -165,4 +165,4 @@ |
166 | 166 | return $index >= NS_MAIN; |
167 | 167 | } |
168 | 168 | |
169 | | -} |
| 169 | +} |
\ No newline at end of file |