r47352 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r47351‎ | r47352 | r47353 >
Date:03:17, 17 February 2009
Author:tstarling
Status:reverted (Comments)
Tags:
Comment:
Added $wgRateLimitsExcludedIPs feature, based on live hack.
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
@@ -1162,10 +1162,17 @@
11631163 */
11641164 public function isPingLimitable() {
11651165 global $wgRateLimitsExcludedGroups;
 1166+ global $wgRateLimitsExcludedIPs;
11661167 if( array_intersect( $this->getEffectiveGroups(), $wgRateLimitsExcludedGroups ) ) {
11671168 // Deprecated, but kept for backwards-compatibility config
11681169 return false;
11691170 }
 1171+ if( in_array( wfGetIP(), $wgRateLimitsExcludedIPs ) ) {
 1172+ // No other good way currently to disable rate limits
 1173+ // for specific IPs. :P
 1174+ // But this is a crappy hack and should die.
 1175+ return false;
 1176+ }
11701177 return !$this->isAllowed('noratelimit');
11711178 }
11721179
Index: trunk/phase3/includes/DefaultSettings.php
@@ -3260,6 +3260,12 @@
32613261 $wgRateLimitsExcludedGroups = array();
32623262
32633263 /**
 3264+ * Array of IPs which should be excluded from rate limits.
 3265+ * This may be useful for whitelisting NAT gateways for conferences, etc.
 3266+ */
 3267+$wgRateLimitsExcludedIPs = array();
 3268+
 3269+/**
32643270 * On Special:Unusedimages, consider images "used", if they are put
32653271 * into a category. Default (false) is not to count those as used.
32663272 */
@@ -3718,4 +3724,4 @@
37193725 /**
37203726 * Preprocessor caching threshold
37213727 */
3722 -$wgPreprocessorCacheThreshold = 1000;
\ No newline at end of file
 3728+$wgPreprocessorCacheThreshold = 1000;
Index: trunk/phase3/RELEASE-NOTES
@@ -106,6 +106,8 @@
107107 * Remove the link to Special:FileDuplicateSearch from the "file history" section
108108 of image description pages as the list of duplicated files is shown in the
109109 next section anyway.
 110+* Added $wgRateLimitsExcludedIPs, to allow specific IPs to be whitelisted from
 111+ rate limits.
110112
111113 === Bug fixes in 1.15 ===
112114 * (bug 16968) Special:Upload no longer throws useless warnings.

Follow-up revisions

RevisionCommit summaryAuthorDate
r51045Reverted r47352, $wgRateLimitsExcludedIPs is to be replaced by APCOND_ISIP.tstarling05:30, 27 May 2009
r57908Reintroduced $wgRateLimitsExcludedIPs from r47352 (removed in r51045). $wgAut...tstarling19:11, 19 October 2009

Comments

#Comment by IAlex (talk | contribs)   11:44, 17 February 2009

Brion already introduced it in r44681, but reverted in r44696 because of the "APCOND_ISIP" and "APCOND_IPINRANGE" conditions for $wgAutopromote introduced in r44592.

#Comment by Tim Starling (talk | contribs)   19:08, 19 October 2009

$wgAutopromote is not used for anonymous users, which makes it rather useless for controlling account creation. I'm going to reintroduce this for now.

Status & tagging log