Software / code / prosody
Diff
plugins/mod_register_limits.lua @ 8586:c3b87a37c100
mod_register_limits: Return reason for disallowing
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Sat, 10 Mar 2018 02:28:29 +0100 |
| parent | 8585:046041a37c1e |
| child | 8738:9f0dc1bbc83b |
line wrap: on
line diff
--- a/plugins/mod_register_limits.lua Sat Mar 10 02:27:09 2018 +0100 +++ b/plugins/mod_register_limits.lua Sat Mar 10 02:28:29 2018 +0100 @@ -63,13 +63,16 @@ elseif ip_in_set(blacklisted_ips, event.ip) then log("debug", "Registration disallowed by blacklist"); event.allowed = false; + event.reason = "Your IP address is blacklisted"; elseif (whitelist_only and not ip_in_set(whitelisted_ips, ip)) then log("debug", "Registration disallowed by whitelist"); 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 log("debug", "Registrations over limit for ip %s", ip or "?"); event.allowed = false; + event.reason = "Too many registrations from this IP address recently"; end end end);