From a0dc6018da763be5c2f4a97e89e2ef504c63811a Mon Sep 17 00:00:00 2001 From: Waqas Hussain Date: Wed, 18 Nov 2009 06:23:41 +0500 Subject: mod_register: Log a debug message when a session's IP is not available. --- plugins/mod_register.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'plugins') diff --git a/plugins/mod_register.lua b/plugins/mod_register.lua index 22724130..2ae01fed 100644 --- a/plugins/mod_register.lua +++ b/plugins/mod_register.lua @@ -117,7 +117,9 @@ module:add_iq_handler("c2s_unauthed", "jabber:iq:register", function (session, s local password = query:child_with_name("password"); if username and password then -- Check that the user is not blacklisted or registering too often - if blacklisted_ips[session.ip] or (whitelist_only and not whitelisted_ips[session.ip]) then + if not session.ip then + module:log("debug", "User's IP not known; can't apply blacklist/whitelist"); + elseif blacklisted_ips[session.ip] or (whitelist_only and not whitelisted_ips[session.ip]) then session.send(st.error_reply(stanza, "cancel", "not-acceptable", "You are not allowed to register an account.")); return; elseif min_seconds_between_registrations and not whitelisted_ips[session.ip] then -- cgit v1.2.3