Index: trunk/extensions/FlaggedRevs/FlaggedRevs.php |
— | — | @@ -14,7 +14,7 @@ |
15 | 15 | $wgExtensionCredits['specialpage'][] = array( |
16 | 16 | 'name' => 'Flagged Revisions', |
17 | 17 | 'author' => array( 'Aaron Schulz', 'Joerg Baach' ), |
18 | | - 'version' => '1.021', |
| 18 | + 'version' => '1.022', |
19 | 19 | 'url' => 'http://www.mediawiki.org/wiki/Extension:FlaggedRevs', |
20 | 20 | 'descriptionmsg' => 'flaggedrevs-desc', |
21 | 21 | ); |
— | — | @@ -145,6 +145,16 @@ |
146 | 146 | 'email' => true, |
147 | 147 | 'userpage' => true |
148 | 148 | ); |
| 149 | + |
| 150 | +# Special:Userrights settings |
| 151 | +## Basic rights for Sysops |
| 152 | +//$wgAddGroups['sysop'] = array( 'editor' ); |
| 153 | +//$wgRemoveGroups['sysop'] = 'array( editor' ); |
| 154 | +## Extra ones for Bureaucrats |
| 155 | +## Add UI page rights just in case we have non-sysop bcrats |
| 156 | +//$wgAddGroups['bureaucrat'] = array( 'reviewer' ); |
| 157 | +//$wgRemoveGroups['bureaucrat'] = array( 'reviewer' ); |
| 158 | + |
149 | 159 | # End of configuration variables. |
150 | 160 | ######### |
151 | 161 | |
— | — | @@ -257,6 +267,8 @@ |
258 | 268 | $wgHooks['userCan'][] = 'FlaggedRevs::userCanView'; |
259 | 269 | # Log parameter |
260 | 270 | $wgHooks['LogLine'][] = 'FlaggedRevs::reviewLogLine'; |
| 271 | + # Disable auto-promotion |
| 272 | + $wgHooks['UserRights'][] = 'FlaggedRevs::recordDemote'; |
261 | 273 | ######### |
262 | 274 | } |
263 | 275 | |
— | — | @@ -1667,6 +1679,20 @@ |
1668 | 1680 | |
1669 | 1681 | return true; |
1670 | 1682 | } |
| 1683 | + |
| 1684 | + /** |
| 1685 | + * Record demotion sso that auto-promote will be disabled |
| 1686 | + */ |
| 1687 | + public static function recordDemote( $u, $addgroup, $removegroup ) { |
| 1688 | + if( $removegroup && in_array('editor',$removegroup) ) { |
| 1689 | + $log = new LogPage( 'rights' ); |
| 1690 | + $targetPage = $u->getUserPage(); |
| 1691 | + # Add dummy entry to mark that a user's editor rights |
| 1692 | + # were removed. This avoid auto-promotion. |
| 1693 | + $log->addEntry( 'erevoke', $targetPage, '', array() ); |
| 1694 | + } |
| 1695 | + return true; |
| 1696 | + } |
1671 | 1697 | |
1672 | 1698 | /** |
1673 | 1699 | * Get a selector of reviewable namespaces |
Index: trunk/extensions/FlaggedRevs/MakeReviewer.i18n.php |
— | — | @@ -35,7 +35,6 @@ |
36 | 36 | 'makereviewer-revoked-r' => '[[User:$1|$1]] no longer has reviewer status.', |
37 | 37 | 'makereviewer-logpage' => 'Editor status log', |
38 | 38 | 'makereviewer-logentrygrant-e' => 'granted editor status to [[$1]]', |
39 | | - 'makereviewer-logentryrevoke-e' => 'removed editor status from [[$1]]', |
40 | 39 | 'makereviewer-logentrygrant-r' => 'granted reviewer status to [[$1]]', |
41 | 40 | 'makereviewer-logentryrevoke-r' => 'removed reviewer status from [[$1]]', |
42 | 41 | 'makereviewer-autosum' => 'autopromoted', |
Index: trunk/extensions/FlaggedRevs/SpecialMakeReviewer.php |
— | — | @@ -26,8 +26,6 @@ |
27 | 27 | $wgAvailableRights[] = 'makereviewer'; |
28 | 28 | $wgAvailableRights[] = 'makevalidator'; |
29 | 29 | |
30 | | -$wgHooks['UserRights'][] = 'efMakeReviewerDemote'; |
31 | | - |
32 | 30 | /** |
33 | 31 | * Determines who can use the extension; as a default, bureaucrats are permitted |
34 | 32 | */ |
— | — | @@ -53,14 +51,3 @@ |
54 | 52 | // can probably be delayed |
55 | 53 | wfLoadExtensionMessages( 'MakeReviewer' ); |
56 | 54 | } |
57 | | - |
58 | | -function efMakeReviewerDemote( $u, $addgroup, $removegroup ) { |
59 | | - if( $removegroup && in_array( 'editor', $removegroup ) ) { |
60 | | - $log = new LogPage( 'rights' ); |
61 | | - $targetPage = $u->getUserPage(); |
62 | | - # Add dummy entry to mark that a user's editor rights |
63 | | - # were removed. This avoid auto-promotion. |
64 | | - $log->addEntry( 'erevoke', $targetPage, '', array() ); |
65 | | - } |
66 | | - return true; |
67 | | -} |