Index: trunk/phase3/includes/User.php |
— | — | @@ -2086,11 +2086,15 @@ |
2087 | 2087 | * @param $action \string action to be checked |
2088 | 2088 | * @return \bool True if action is allowed, else false |
2089 | 2089 | */ |
2090 | | - function isAllowed($action='') { |
| 2090 | + function isAllowed( $action = '' ) { |
2091 | 2091 | if ( $action === '' ) |
2092 | | - // In the spirit of DWIM |
2093 | | - return true; |
2094 | | - |
| 2092 | + return true; // In the spirit of DWIM |
| 2093 | + # Patrolling may not be enabled |
| 2094 | + if( $action === 'patrol' || $action === 'autopatrol' ) { |
| 2095 | + global $wgUseRCPatrol, $wgUseNPPatrol; |
| 2096 | + if( !$wgUseRCPatrol && !$wgUseNPPatrol ) |
| 2097 | + return true; |
| 2098 | + } |
2095 | 2099 | # Use strict parameter to avoid matching numeric 0 accidentally inserted |
2096 | 2100 | # by misconfiguration: 0 == 'foo' |
2097 | 2101 | return in_array( $action, $this->getRights(), true ); |