Throw in quick hack $wgRateLimitsExcludedIPs so we don't have to do a live hack
authorBrion Vibber <brion@users.mediawiki.org>
Tue, 16 Dec 2008 18:43:42 +0000 (18:43 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Tue, 16 Dec 2008 18:43:42 +0000 (18:43 +0000)
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.

includes/DefaultSettings.php
includes/User.php

index 6a00a8c..28a91d5 100644 (file)
@@ -3204,6 +3204,16 @@ $wgRateLimitLog = null;
  */
 $wgRateLimitsExcludedGroups = array();
 
+/**
+ * Array of IPs which should never trigger the rate limiter.
+ * Really this is a cruddy hack and should be replaced with
+ * an "anti-block" or something which can be managed through
+ * the wiki UI.
+ *
+ *  $wgRateLimitsExcludedIPs = array( '1.2.3.4' );
+ */
+$wgRateLimitsExcludedIPs = array();
+
 /**
  * On Special:Unusedimages, consider images "used", if they are put
  * into a category. Default (false) is not to count those as used.
index 85701e3..bd0fe3a 100644 (file)
@@ -1146,10 +1146,17 @@ class User {
         */
        public function isPingLimitable() {
                global $wgRateLimitsExcludedGroups;
+               global $wgRateLimitsExcludedIPs;
                if( array_intersect( $this->getEffectiveGroups(), $wgRateLimitsExcludedGroups ) ) {
                        // Deprecated, but kept for backwards-compatibility config
                        return false;
                }
+               if( in_array( wfGetIP(), $wgRateLimitsExcludedIPs ) ) {
+                       // No other good way currently to disable rate limits
+                       // for specific IPs. :P
+                       // But this is a crappy hack and should die.
+                       return false;
+               }
                return !$this->isAllowed('noratelimit');
        }