r14184 - Code Review

From MediaWiki.org

Jump to: navigation, search
Repository:MediaWiki
Revision:r14183 | r14184 (on ViewVC) | r14185 >
Date:17:47, 12 May 2006
Author:robchurch
Status:new
Tags:
Comment:Groups which won't hit the rate limiter now configurable with $wgRateLimitsExcludedGroups
Modified paths:

Diff [purge]

Index: trunk/phase3/includes/User.php
===================================================================
--- trunk/phase3/includes/User.php	(revision 14183)
+++ trunk/phase3/includes/User.php	(revision 14184)
@@ -525,15 +525,17 @@
 	 * @public
 	 */
 	function pingLimiter( $action='edit' ) {
-		global $wgRateLimits;
+		global $wgRateLimits, $wgRateLimitsExcludedGroups;
 		if( !isset( $wgRateLimits[$action] ) ) {
 			return false;
 		}
-		if( $this->isAllowed( 'delete' ) ) {
-			// goddam cabal
-			return false;
+		
+		# Some groups shouldn't trigger the ping limiter, ever
+		foreach( $this->getGroups() as $group ) {
+			if( array_search( $group, $wgRateLimitsExcludedGroups ) !== false )
+				return false;
 		}
-
+		
 		global $wgMemc, $wgDBname, $wgRateLimitLog;
 		$fname = 'User::pingLimiter';
 		wfProfileIn( $fname );
Index: trunk/phase3/includes/DefaultSettings.php
===================================================================
--- trunk/phase3/includes/DefaultSettings.php	(revision 14183)
+++ trunk/phase3/includes/DefaultSettings.php	(revision 14184)
@@ -1823,6 +1823,9 @@
 		'ip'     => null,
 		'subnet' => null,
 		),
+	'mailpassword' => array(
+		'ip' => NULL,
+		),
 	);
 
 /**
@@ -1831,6 +1834,11 @@
 $wgRateLimitLog = null;
 
 /**
+ * Array of groups which should never trigger the rate limiter
+ */
+$wgRateLimitsExcludedGroups = array( 'sysop', 'bureaucrat' );
+
+/**
  * On Special:Unusedimages, consider images "used", if they are put
  * into a category. Default (false) is not to count those as used.
  */
Index: trunk/phase3/RELEASE-NOTES
===================================================================
--- trunk/phase3/RELEASE-NOTES	(revision 14183)
+++ trunk/phase3/RELEASE-NOTES	(revision 14184)
@@ -248,8 +248,9 @@
 * (bug 5915) Update to Indonesian localisation (id)
 * (bug 5913) Update for German localisation (de)
 * (bug 5905) Plural support for Bosnian localisation (bs)
+* Groups which won't hit the rate limiter now configurable with
+  $wgRateLimitsExcludedGroups
 
-
 == Compatibility ==
 
 Older PHP 4.2 and 4.1 releases are no longer supported; PHP 4 users must
Views
Toolbox