changeset 3868:4f050cf6627e

surge protection: exclude localnet no matter whether user is known or not
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Thu, 17 Jul 2008 13:20:01 +0200
parents 4082eab1fe16
children 4f0dcb5fe7a6
files MoinMoin/request/__init__.py
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/request/__init__.py	Thu Jul 17 11:39:28 2008 +0200
+++ b/MoinMoin/request/__init__.py	Thu Jul 17 13:20:01 2008 +0200
@@ -263,10 +263,11 @@
         if not limits:
             return False
 
+        if self.remote_addr.startswith('127.'): # localnet
+            return False
+
         validuser = self.user.valid
         current_id = validuser and self.user.name or self.remote_addr
-        if not validuser and current_id.startswith('127.'): # localnet
-            return False
         current_action = self.action
 
         default_limit = self.cfg.surge_action_limits.get('default', (30, 60))