r44681 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r44680‎ | r44681 | r44682 >
Date:18:43, 16 December 2008
Author:brion
Status:reverted (Comments)
Tags:
Comment:
Throw in quick hack $wgRateLimitsExcludedIPs so we don't have to do a live hack
every time somebody runs an exciting event where they're going to register
a lot of accounts.
Should be killed and replaced with an on-wiki system for approvals or temporary lifting of limits as a sort of anti-block.
Modified paths:
  • /trunk/phase3/includes/DefaultSettings.php (modified) (history)
  • /trunk/phase3/includes/User.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/DefaultSettings.php
@@ -3205,6 +3205,16 @@
32063206 $wgRateLimitsExcludedGroups = array();
32073207
32083208 /**
 3209+ * Array of IPs which should never trigger the rate limiter.
 3210+ * Really this is a cruddy hack and should be replaced with
 3211+ * an "anti-block" or something which can be managed through
 3212+ * the wiki UI.
 3213+ *
 3214+ * $wgRateLimitsExcludedIPs = array( '1.2.3.4' );
 3215+ */
 3216+$wgRateLimitsExcludedIPs = array();
 3217+
 3218+/**
32093219 * On Special:Unusedimages, consider images "used", if they are put
32103220 * into a category. Default (false) is not to count those as used.
32113221 */
Index: trunk/phase3/includes/User.php
@@ -1146,10 +1146,17 @@
11471147 */
11481148 public function isPingLimitable() {
11491149 global $wgRateLimitsExcludedGroups;
 1150+ global $wgRateLimitsExcludedIPs;
11501151 if( array_intersect( $this->getEffectiveGroups(), $wgRateLimitsExcludedGroups ) ) {
11511152 // Deprecated, but kept for backwards-compatibility config
11521153 return false;
11531154 }
 1155+ if( in_array( wfGetIP(), $wgRateLimitsExcludedIPs ) ) {
 1156+ // No other good way currently to disable rate limits
 1157+ // for specific IPs. :P
 1158+ // But this is a crappy hack and should die.
 1159+ return false;
 1160+ }
11541161 return !$this->isAllowed('noratelimit');
11551162 }
11561163

Follow-up revisions

RevisionCommit summaryAuthorDate
r44696Reverting r44681 "Throw in quick hack $wgRateLimitsExcludedIPs so we don't ha...brion00:05, 17 December 2008

Comments

#Comment by Aaron Schulz (talk | contribs)   22:01, 16 December 2008
  • shudder*
#Comment by Brion VIBBER (talk | contribs)   23:50, 16 December 2008

r44592 (bug 7492) seems to cover this case, so can revert this...

#Comment by Brion VIBBER (talk | contribs)   00:06, 17 December 2008

Reverted in r44696

Status & tagging log