aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2009-11-18 06:23:41 +0500
committerWaqas Hussain <waqas20@gmail.com>2009-11-18 06:23:41 +0500
commita0dc6018da763be5c2f4a97e89e2ef504c63811a (patch)
tree085a3c68d2f7ca0567d16dcfeed2e9596603efe1
parent09a6ddbe28ac8c1a174003d0395df1dff43cfb3e (diff)
downloadprosody-a0dc6018da763be5c2f4a97e89e2ef504c63811a.tar.gz
prosody-a0dc6018da763be5c2f4a97e89e2ef504c63811a.zip
mod_register: Log a debug message when a session's IP is not available.
-rw-r--r--plugins/mod_register.lua4
1 files changed, 3 insertions, 1 deletions
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