Software /
code /
prosody
Changeset
8585:046041a37c1e
mod_register_limits: Log message for white- and blacklist hits separate
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sat, 10 Mar 2018 02:27:09 +0100 |
parents | 8584:e3d953481f7d |
children | 8586:c3b87a37c100 |
files | plugins/mod_register_limits.lua |
diffstat | 1 files changed, 5 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/plugins/mod_register_limits.lua Sat Mar 10 02:24:18 2018 +0100 +++ b/plugins/mod_register_limits.lua Sat Mar 10 02:27:09 2018 +0100 @@ -60,8 +60,11 @@ 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