diff options
author | Kim Alvefur <zash@zash.se> | 2018-03-10 02:27:09 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2018-03-10 02:27:09 +0100 |
commit | 9eb4ffc53d9085c40e4f05386a614816f2c872fb (patch) | |
tree | da2f84532948c051c3ebbd24e404c99485e160c2 /plugins | |
parent | 549d89cb0d07728a2e4d28f930d182deef3b7a72 (diff) | |
download | prosody-9eb4ffc53d9085c40e4f05386a614816f2c872fb.tar.gz prosody-9eb4ffc53d9085c40e4f05386a614816f2c872fb.zip |
mod_register_limits: Log message for white- and blacklist hits separate
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/mod_register_limits.lua | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/plugins/mod_register_limits.lua b/plugins/mod_register_limits.lua index 1d12f7f2..94e2b381 100644 --- a/plugins/mod_register_limits.lua +++ b/plugins/mod_register_limits.lua @@ -60,8 +60,11 @@ module:hook("user-registering", function (event) 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) or (whitelist_only and not ip_in_set(whitelisted_ips, ip)) then - log("debug", "Registration disallowed by white- or blacklist"); + elseif ip_in_set(blacklisted_ips, event.ip) then + log("debug", "Registration disallowed by blacklist"); + event.allowed = false; + elseif (whitelist_only and not ip_in_set(whitelisted_ips, ip)) then + log("debug", "Registration disallowed by whitelist"); event.allowed = false; elseif throttle_max and not ip_in_set(whitelisted_ips, ip) then if not check_throttle(event.ip) then |