Comparison

plugins/mod_register_limits.lua @ 8740:5dc8f509496c

mod_register_limits: Promote log message about inability to apply black/whitelists to a warning
author Kim Alvefur <zash@zash.se>
date Tue, 10 Apr 2018 01:32:52 +0200
parent 8739:5fb525eb72a2
child 10286:23b26a414d71
comparison
equal deleted inserted replaced
8739:5fb525eb72a2 8740:5dc8f509496c
57 module:hook("user-registering", function (event) 57 module:hook("user-registering", function (event)
58 local session = event.session; 58 local session = event.session;
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", "IP not known; can't apply blacklist/whitelist"); 62 log("warn", "IP not known; can't apply blacklist/whitelist");
63 elseif ip_in_set(blacklisted_ips, ip) then 63 elseif ip_in_set(blacklisted_ips, ip) then
64 log("debug", "Registration disallowed by blacklist"); 64 log("debug", "Registration disallowed by blacklist");
65 event.allowed = false; 65 event.allowed = false;
66 event.reason = "Your IP address is blacklisted"; 66 event.reason = "Your IP address is blacklisted";
67 elseif (whitelist_only and not ip_in_set(whitelisted_ips, ip)) then 67 elseif (whitelist_only and not ip_in_set(whitelisted_ips, ip)) then