Index: trunk/extensions/FlaggedRevs/FlaggedRevs.php |
— | — | @@ -341,9 +341,6 @@ |
342 | 342 | $wgAPIModules['review'] = 'ApiReview'; |
343 | 343 | |
344 | 344 | ######### Hook attachments ######### |
345 | | -# Remove stand-alone patrolling |
346 | | -$wgHooks['UserGetRights'][] = 'FlaggedRevsHooks::stripPatrolRights'; |
347 | | - |
348 | 345 | # Autopromote Editors |
349 | 346 | $wgHooks['ArticleSaveComplete'][] = 'FlaggedRevsHooks::autoPromoteUser'; |
350 | 347 | # Adds table link references to include ones from the stable version |
Index: trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php |
— | — | @@ -2,19 +2,6 @@ |
3 | 3 | |
4 | 4 | class FlaggedRevsHooks { |
5 | 5 | /** |
6 | | - * Remove 'autopatrol' rights. Reviewing revisions will patrol them as well. |
7 | | - */ |
8 | | - public static function stripPatrolRights( $user, &$rights ) { |
9 | | - # Use only our extension mechanisms |
10 | | - foreach( $rights as $n => $right ) { |
11 | | - if( $right == 'autopatrol' ) { |
12 | | - unset($rights[$n]); |
13 | | - } |
14 | | - } |
15 | | - return true; |
16 | | - } |
17 | | - |
18 | | - /** |
19 | 6 | * Add FlaggedRevs css/js. |
20 | 7 | */ |
21 | 8 | public static function injectStyleAndJS() { |
— | — | @@ -626,21 +613,22 @@ |
627 | 614 | } |
628 | 615 | |
629 | 616 | /** |
630 | | - * Don't let users pages pages not in $wgFlaggedRevsPatrolNamespaces |
| 617 | + * Don't let users patrol pages not in $wgFlaggedRevsPatrolNamespaces |
631 | 618 | */ |
632 | 619 | public static function userCanPatrol( $title, $user, $action, &$result ) { |
633 | | - if( $action != 'patrol' || $result===false ) { |
| 620 | + if( $result === false ) return true; // nothing to do |
| 621 | + if( $action != 'patrol' && $action != 'autopatrol' ) { |
634 | 622 | return true; |
635 | 623 | } |
636 | 624 | # Pages in reviewable namespace can be patrolled IF reviewing |
637 | 625 | # is disabled for pages that don't show the stable by default. |
638 | 626 | # In such cases, we let people with 'review' rights patrol them. |
639 | | - if( FlaggedRevs::isPageReviewable($title) && !$user->isAllowed( 'review' ) ) { |
| 627 | + if( FlaggedRevs::isPageReviewable($title) && !$user->isAllowed('review') ) { |
640 | 628 | $result = false; |
641 | 629 | return false; |
642 | 630 | } |
643 | 631 | $flaggedArticle = FlaggedArticle::getTitleInstance( $title ); |
644 | | - # The page must be in a patrollable namespace... |
| 632 | + # The page must be in a patrollable namespace ($wgFlaggedRevsPatrolNamespaces)... |
645 | 633 | if( !$flaggedArticle->isPatrollable() ) { |
646 | 634 | global $wgUseNPPatrol; |
647 | 635 | # ...unless the page is not in a reviewable namespace and |