r57908 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r57907‎ | r57908 | r57909 >
Date:19:11, 19 October 2009
Author:tstarling
Status:deferred (Comments)
Tags:
Comment:
Reintroduced $wgRateLimitsExcludedIPs from r47352 (removed in r51045). $wgAutopromote does not work for anonymous users.
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/DefaultSettings.php (modified) (history)
  • /trunk/phase3/includes/User.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/User.php
@@ -1219,11 +1219,18 @@
12201220 */
12211221 public function isPingLimitable() {
12221222 global $wgRateLimitsExcludedGroups;
 1223+ global $wgRateLimitsExcludedIPs;
12231224 if( array_intersect( $this->getEffectiveGroups(), $wgRateLimitsExcludedGroups ) ) {
12241225 // Deprecated, but kept for backwards-compatibility config
12251226 return false;
12261227 }
1227 - return !$this->isAllowed( 'noratelimit' );
 1228+ if( in_array( wfGetIP(), $wgRateLimitsExcludedIPs ) ) {
 1229+ // No other good way currently to disable rate limits
 1230+ // for specific IPs. :P
 1231+ // But this is a crappy hack and should die.
 1232+ return false;
 1233+ }
 1234+ return !$this->isAllowed('noratelimit');
12281235 }
12291236
12301237 /**
Index: trunk/phase3/includes/DefaultSettings.php
@@ -3582,6 +3582,12 @@
35833583 $wgRateLimitsExcludedGroups = array();
35843584
35853585 /**
 3586+ * Array of IPs which should be excluded from rate limits.
 3587+ * This may be useful for whitelisting NAT gateways for conferences, etc.
 3588+ */
 3589+$wgRateLimitsExcludedIPs = array();
 3590+
 3591+/**
35863592 * On Special:Unusedimages, consider images "used", if they are put
35873593 * into a category. Default (false) is not to count those as used.
35883594 */
Index: trunk/phase3/RELEASE-NOTES
@@ -252,6 +252,8 @@
253253 * Rewrote Special:Upload to allow easier extension.
254254 * Upload errors that can be solved by changing the filename now do not require
255255 reuploading.
 256+* Added $wgRateLimitsExcludedIPs, to allow specific IPs to be whitelisted from
 257+ rate limits.
256258
257259 === Bug fixes in 1.16 ===
258260

Follow-up revisions

RevisionCommit summaryAuthorDate
r57910Merging r57908 from trunktstarling19:35, 19 October 2009

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r47352Added $wgRateLimitsExcludedIPs feature, based on live hack.tstarling03:17, 17 February 2009
r51045Reverted r47352, $wgRateLimitsExcludedIPs is to be replaced by APCOND_ISIP.tstarling05:30, 27 May 2009

Comments

#Comment by 😂 (talk | contribs)   10:35, 2 December 2009

Per your own comments, this is an icky hack. Leaving status as new because I don't think it's a fixme (definitely not a deployment/branch blocker), but I don't like the idea of it being marked Ok. Ideally we should be using Autopromote for this like I intended with APCOND_ISIP, etc.

IIRC, the main concerns we had was the efficiency of running the Autopromote code for anonymous users (more to the point: will it scale to WMF?)

#Comment by Tim Starling (talk | contribs)   12:09, 2 December 2009

I think it was Brion's comment, not mine. I'm not so concerned about it.

Status & tagging log