r66656 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r66655‎ | r66656 | r66657 >
Date:20:49, 19 May 2010
Author:aaron
Status:ok
Tags:
Comment:
Added temporary $wgFlaggedRevsProtectQuota var for trial
Modified paths:
  • /trunk/extensions/FlaggedRevs/forms/PageStabilityForm.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/language/Stabilization.i18n.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/language/Stabilization.i18n.php
@@ -51,6 +51,7 @@
5252 'stabilize_expiry_invalid' => 'Invalid expiration date.',
5353 'stabilize_expiry_old' => 'This expiration time has already passed.',
5454 'stabilize_denied' => 'Permission denied.',
 55+ 'stabilize_protect_quota' => 'The maximum number of currently flag-protected pages has already been reached.', # do not translate
5556 'stabilize-expiring' => 'expires $1 (UTC)',
5657 'stabilization-review' => 'Mark the current revision checked',
5758 );
Index: trunk/extensions/FlaggedRevs/forms/PageStabilityForm.php
@@ -553,6 +553,18 @@
554554 }
555555
556556 protected function reallyCheckSettings() {
 557+ # WMF temp hack...protection limit quota
 558+ global $wgFlaggedRevsProtectQuota;
 559+ if ( isset( $wgFlaggedRevsProtectQuota ) // quota exists
 560+ && $this->autoreview != '' // and we are protecting
 561+ && FlaggedRevs::getProtectionLevel( $this->oldConfig ) == 'none' ) // and page is unprotected
 562+ {
 563+ $dbw = wfGetDB( DB_MASTER );
 564+ $count = $dbw->selectField( 'flaggedpage_config', 'COUNT(*)', '', __METHOD__ );
 565+ if ( $count >= $wgFlaggedRevsProtectQuota ) {
 566+ return 'stabilize_protect_quota';
 567+ }
 568+ }
557569 $this->loadReason();
558570 $this->loadExpiry();
559571 # Autoreview only when protecting currently unprotected pages

Follow-up revisions

RevisionCommit summaryAuthorDate
r66657Follow-up r66656: ignore messageraymond20:52, 19 May 2010

Status & tagging log