r45855 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r45854‎ | r45855 | r45856 >
Date:23:32, 17 January 2009
Author:aaron
Status:resolved (Comments)
Tags:
Comment:
isAllowed('patrol') now returns false if patrolling is disabled
Modified paths:
  • /trunk/phase3/includes/User.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/User.php
@@ -2086,11 +2086,15 @@
20872087 * @param $action \string action to be checked
20882088 * @return \bool True if action is allowed, else false
20892089 */
2090 - function isAllowed($action='') {
 2090+ function isAllowed( $action = '' ) {
20912091 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+ }
20952099 # Use strict parameter to avoid matching numeric 0 accidentally inserted
20962100 # by misconfiguration: 0 == 'foo'
20972101 return in_array( $action, $this->getRights(), true );

Follow-up revisions

RevisionCommit summaryAuthorDate
r45881Fix typo in r45855aaron19:23, 18 January 2009

Comments

#Comment by Voice of All (talk | contribs)   19:27, 18 January 2009

Fix obvious typo in r45881

#Comment by Brion VIBBER (talk | contribs)   22:10, 20 January 2009

Appears to be targetted at r45793

Status & tagging log