# HG changeset patch # User Kim Alvefur # Date 1523316674 -7200 # Node ID 9f0dc1bbc83b5973656d19b391026b1c56e3bc53 # Parent 6d71845bf56f66df8008e81a1fa05ba42b2b0ef8 mod_register_limits: Use existing local variable diff -r 6d71845bf56f -r 9f0dc1bbc83b plugins/mod_register_limits.lua --- a/plugins/mod_register_limits.lua Mon Apr 09 22:05:49 2018 +0200 +++ b/plugins/mod_register_limits.lua Tue Apr 10 01:31:14 2018 +0200 @@ -60,7 +60,7 @@ local log = session and session.log or module._log; if not ip then log("debug", "User's IP not known; can't apply blacklist/whitelist"); - elseif ip_in_set(blacklisted_ips, event.ip) then + elseif ip_in_set(blacklisted_ips, ip) then log("debug", "Registration disallowed by blacklist"); event.allowed = false; event.reason = "Your IP address is blacklisted"; @@ -69,7 +69,7 @@ event.allowed = false; event.reason = "Your IP address is not whitelisted"; elseif throttle_max and not ip_in_set(whitelisted_ips, ip) then - if not check_throttle(event.ip) then + if not check_throttle(ip) then log("debug", "Registrations over limit for ip %s", ip or "?"); event.allowed = false; event.reason = "Too many registrations from this IP address recently";