r72052 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r72051‎ | r72052 | r72053 >
Date:21:19, 31 August 2010
Author:aaron
Status:ok
Tags:
Comment:
Removed $wgFlaggedRevsVisible stuff...not used by WMF
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
@@ -232,12 +232,6 @@
233233 # How far the logs for overseeing quality revisions and depreciations go
234234 $wgFlaggedRevsOversightAge = 30 * 24 * 3600;
235235
236 -# Flagged revisions are always visible to users with rights below.
237 -# Use '*' for non-user accounts. This is for read-restricted wikis.
238 -$wgFlaggedRevsVisible = array();
239 -# If $wgFlaggedRevsVisible is populated, it is applied to talk pages too
240 -$wgFlaggedRevsTalkVisible = true;
241 -
242236 # How long before Special:ValidationStatistics is updated.
243237 # Set to false to disable (perhaps using a cron job instead).
244238 $wgFlaggedRevsStatsAge = 2 * 3600; // 2 hours
@@ -530,16 +524,12 @@
531525 # ########
532526
533527 function efSetFlaggedRevsConditionalHooks() {
534 - global $wgHooks, $wgFlaggedRevsVisible;
 528+ global $wgHooks;
535529 # Mark items in user contribs
536530 if ( !FlaggedRevs::useOnlyIfProtected() ) {
537531 $wgHooks['ContribsPager::getQueryInfo'][] = 'FlaggedRevsHooks::addToContribsQuery';
538532 $wgHooks['ContributionsLineEnding'][] = 'FlaggedRevsHooks::addToContribsLine';
539533 }
540 - # Visibility - experimental
541 - if ( !empty( $wgFlaggedRevsVisible ) ) {
542 - $wgHooks['getUserPermissionsErrors'][] = 'FlaggedRevsHooks::userCanView';
543 - }
544534 if ( FlaggedRevs::useProtectionLevels() ) {
545535 # Add protection form field
546536 $wgHooks['ProtectionForm::buildForm'][] = 'FlaggedRevsHooks::onProtectionForm';
Index: trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php
@@ -633,43 +633,6 @@
634634 return true;
635635 }
636636
637 - /**
638 - * Allow users to view reviewed pages
639 - */
640 - public static function userCanView( Title $title, $user, $action, &$result ) {
641 - global $wgFlaggedRevsVisible, $wgFlaggedRevsTalkVisible, $wgTitle;
642 - # Assume $action may still not be set, in which case, treat it as 'view'...
643 - # Return out if $result set to false by some other hooked call.
644 - if ( $action !== 'read' || $result === false || empty( $wgFlaggedRevsVisible ) )
645 - return true;
646 - # Admin may set this to false, rather than array()...
647 - $groups = $user->getGroups();
648 - $groups[] = '*';
649 - if ( !array_intersect( $groups, $wgFlaggedRevsVisible ) )
650 - return true;
651 - # Is this a talk page?
652 - if ( $wgFlaggedRevsTalkVisible && $title->isTalkPage() ) {
653 - $result = true;
654 - return true;
655 - }
656 - # See if there is a stable version. Also, see if, given the page
657 - # config and URL params, the page can be overriden. The later
658 - # only applies on page views of $title.
659 - $flaggedArticle = FlaggedArticle::getTitleInstance( $title );
660 - if ( !empty( $wgTitle ) && $wgTitle->equals( $title ) ) {
661 - $view = FlaggedArticleView::singleton();
662 - // Cache stable version while we are at it.
663 - if ( $view->pageOverride() && $flaggedArticle->getStableRev() ) {
664 - $result = true;
665 - }
666 - } else {
667 - if ( FlaggedRevision::newFromStable( $title ) ) {
668 - $result = true;
669 - }
670 - }
671 - return true;
672 - }
673 -
674637 /**
675638 * When an edit is made by a user, review it if either:
676639 * (a) The user can 'autoreview' and the edit's base revision is a checked

Status & tagging log