r32338 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r32337‎ | r32338 | r32339 >
Date:23:46, 22 March 2008
Author:aaron
Status:old
Tags:
Comment:
*Move demote log hook to main file
*Add suggest userrights permission (makereviewer may become obsolete)
Modified paths:
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/MakeReviewer.i18n.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/SpecialMakeReviewer.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/FlaggedRevs.php
@@ -14,7 +14,7 @@
1515 $wgExtensionCredits['specialpage'][] = array(
1616 'name' => 'Flagged Revisions',
1717 'author' => array( 'Aaron Schulz', 'Joerg Baach' ),
18 - 'version' => '1.021',
 18+ 'version' => '1.022',
1919 'url' => 'http://www.mediawiki.org/wiki/Extension:FlaggedRevs',
2020 'descriptionmsg' => 'flaggedrevs-desc',
2121 );
@@ -145,6 +145,16 @@
146146 'email' => true,
147147 'userpage' => true
148148 );
 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+
149159 # End of configuration variables.
150160 #########
151161
@@ -257,6 +267,8 @@
258268 $wgHooks['userCan'][] = 'FlaggedRevs::userCanView';
259269 # Log parameter
260270 $wgHooks['LogLine'][] = 'FlaggedRevs::reviewLogLine';
 271+ # Disable auto-promotion
 272+ $wgHooks['UserRights'][] = 'FlaggedRevs::recordDemote';
261273 #########
262274 }
263275
@@ -1667,6 +1679,20 @@
16681680
16691681 return true;
16701682 }
 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+ }
16711697
16721698 /**
16731699 * Get a selector of reviewable namespaces
Index: trunk/extensions/FlaggedRevs/MakeReviewer.i18n.php
@@ -35,7 +35,6 @@
3636 'makereviewer-revoked-r' => '[[User:$1|$1]] no longer has reviewer status.',
3737 'makereviewer-logpage' => 'Editor status log',
3838 'makereviewer-logentrygrant-e' => 'granted editor status to [[$1]]',
39 - 'makereviewer-logentryrevoke-e' => 'removed editor status from [[$1]]',
4039 'makereviewer-logentrygrant-r' => 'granted reviewer status to [[$1]]',
4140 'makereviewer-logentryrevoke-r' => 'removed reviewer status from [[$1]]',
4241 'makereviewer-autosum' => 'autopromoted',
Index: trunk/extensions/FlaggedRevs/SpecialMakeReviewer.php
@@ -26,8 +26,6 @@
2727 $wgAvailableRights[] = 'makereviewer';
2828 $wgAvailableRights[] = 'makevalidator';
2929
30 -$wgHooks['UserRights'][] = 'efMakeReviewerDemote';
31 -
3230 /**
3331 * Determines who can use the extension; as a default, bureaucrats are permitted
3432 */
@@ -53,14 +51,3 @@
5452 // can probably be delayed
5553 wfLoadExtensionMessages( 'MakeReviewer' );
5654 }
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 -}

Status & tagging log