From 6fb1c0146d3bbd0c5263d93f38753ddef3dc3f99 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Sat, 17 Jan 2009 23:32:27 +0000 Subject: [PATCH] isAllowed('patrol') now returns false if patrolling is disabled --- includes/User.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/includes/User.php b/includes/User.php index dd823cc6fd..af7871c289 100644 --- a/includes/User.php +++ b/includes/User.php @@ -2086,11 +2086,15 @@ class User { * @param $action \string action to be checked * @return \bool True if action is allowed, else false */ - function isAllowed($action='') { + function isAllowed( $action = '' ) { if ( $action === '' ) - // In the spirit of DWIM - return true; - + return true; // In the spirit of DWIM + # Patrolling may not be enabled + if( $action === 'patrol' || $action === 'autopatrol' ) { + global $wgUseRCPatrol, $wgUseNPPatrol; + if( !$wgUseRCPatrol && !$wgUseNPPatrol ) + return true; + } # Use strict parameter to avoid matching numeric 0 accidentally inserted # by misconfiguration: 0 == 'foo' return in_array( $action, $this->getRights(), true ); -- 2.20.1