aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_bosh.lua1
-rw-r--r--plugins/mod_console.lua2
-rw-r--r--plugins/mod_register.lua4
3 files changed, 6 insertions, 1 deletions
diff --git a/plugins/mod_bosh.lua b/plugins/mod_bosh.lua
index af13bde9..3e41ef7b 100644
--- a/plugins/mod_bosh.lua
+++ b/plugins/mod_bosh.lua
@@ -254,6 +254,7 @@ function stream_callbacks.handlestanza(request, stanza)
if stanza.attr.xmlns == xmlns_bosh then
stanza.attr.xmlns = "jabber:client";
end
+ session.ip = request.handler.ip();
core_process_stanza(session, stanza);
end
end
diff --git a/plugins/mod_console.lua b/plugins/mod_console.lua
index 5a092298..82045232 100644
--- a/plugins/mod_console.lua
+++ b/plugins/mod_console.lua
@@ -650,3 +650,5 @@ if option and option ~= "short" and option ~= "full" and option ~= "graphic" the
end
end
end
+
+prosody.net_activate_ports("console", "console", {5582}, "tcp");
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