Software /
code /
prosody
Changeset
8738:9f0dc1bbc83b
mod_register_limits: Use existing local variable
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Tue, 10 Apr 2018 01:31:14 +0200 |
parents | 8737:6d71845bf56f |
children | 8739:5fb525eb72a2 |
files | plugins/mod_register_limits.lua |
diffstat | 1 files changed, 2 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- 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";