r45041 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r45040‎ | r45041 | r45042 >
Date:20:11, 25 December 2008
Author:aaron
Status:deferred
Tags:
Comment:
(bug 16792) Improve global bot handling
Modified paths:
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/FlaggedRevs.php
@@ -181,9 +181,6 @@
182182 # Let this stand alone just in case...
183183 $wgGroupPermissions['reviewer']['review'] = true;
184184
185 -$wgGroupPermissions['bot']['autoreview'] = true;
186 -$wgGroupPermissions['bot']['autopatrolother'] = true;
187 -
188185 # Stable version selection and default page revision selection can be set per page.
189186 $wgGroupPermissions['sysop']['stablesettings'] = true;
190187 # Sysops can always move stable pages
Index: trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php
@@ -675,7 +675,10 @@
676676 FlaggedRevs::autoReviewEdit( $article, $user, $rev->getText(), $rev, null, false );
677677 return true;
678678 }
679 - if( !$wgFlaggedRevsAutoReview || !$user->isAllowed('autoreview') )
 679+ # Auto-reviewing must be enabled
 680+ if( !$wgFlaggedRevsAutoReview ) return true;
 681+ # User must have the required permissions
 682+ if( !$user->isAllowed('autoreview') && !$user->isAllowed('bot') )
680683 return true;
681684 # If $baseRevId passed in, this is a null edit
682685 $isNullEdit = $baseRevId ? true : false;
@@ -751,7 +754,7 @@
752755 GAID_FOR_UPDATE );
753756 // Can this be patrolled?
754757 } else if( FlaggedRevs::isPagePatrollable( $rc->getTitle() ) ) {
755 - $patrol = $wgUser->isAllowed('autopatrolother');
 758+ $patrol = $wgUser->isAllowed('autopatrolother') || $wgUser->isAllowed('bot');
756759 $record = true;
757760 } else {
758761 global $wgUseNPPatrol;
@@ -782,7 +785,7 @@
783786 # Grab current groups
784787 $groups = $user->getGroups();
785788 # Do not give this to current holders or bots
786 - if( in_array( 'bot', $groups ) || in_array( 'editor', $groups ) ) {
 789+ if( $user->isAllowed('bot') || in_array('bot',$groups) || in_array('editor',$groups) ) {
787790 wfProfileOut( __METHOD__ );
788791 return true;
789792 }

Status & tagging log