From 7bb23790b3b9162909b9bb0af779b0327f5a3fda Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sat, 10 Mar 2018 02:28:29 +0100 Subject: mod_register_limits: Return reason for disallowing --- plugins/mod_register_limits.lua | 3 +++ 1 file changed, 3 insertions(+) (limited to 'plugins/mod_register_limits.lua') diff --git a/plugins/mod_register_limits.lua b/plugins/mod_register_limits.lua index 94e2b381..685a84bd 100644 --- a/plugins/mod_register_limits.lua +++ b/plugins/mod_register_limits.lua @@ -63,13 +63,16 @@ module:hook("user-registering", function (event) 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); -- cgit v1.2.3