Comparison

plugins/mod_register_limits.lua @ 8584:e3d953481f7d

mod_register_limits: Log a debug message when disallowing registration by ewhite- or blacklist
author Kim Alvefur <zash@zash.se>
date Sat, 10 Mar 2018 02:24:18 +0100
parent 8485:0e02c6de5c02
child 8585:046041a37c1e
comparison
equal deleted inserted replaced
8583:9918f324a0be 8584:e3d953481f7d
59 local ip = event.ip or session and session.ip; 59 local ip = event.ip or session and session.ip;
60 local log = session and session.log or module._log; 60 local log = session and session.log or module._log;
61 if not ip then 61 if not ip then
62 log("debug", "User's IP not known; can't apply blacklist/whitelist"); 62 log("debug", "User's IP not known; can't apply blacklist/whitelist");
63 elseif ip_in_set(blacklisted_ips, event.ip) or (whitelist_only and not ip_in_set(whitelisted_ips, ip)) then 63 elseif ip_in_set(blacklisted_ips, event.ip) or (whitelist_only and not ip_in_set(whitelisted_ips, ip)) then
64 log("debug", "Registration disallowed by white- or blacklist");
64 event.allowed = false; 65 event.allowed = false;
65 elseif throttle_max and not ip_in_set(whitelisted_ips, ip) then 66 elseif throttle_max and not ip_in_set(whitelisted_ips, ip) then
66 if not check_throttle(event.ip) then 67 if not check_throttle(event.ip) then
67 log("debug", "Registrations over limit for ip %s", ip or "?"); 68 log("debug", "Registrations over limit for ip %s", ip or "?");
68 event.allowed = false; 69 event.allowed = false;