diff options
author | Tobias Markmann <tm@ayena.de> | 2009-11-19 17:53:52 +0100 |
---|---|---|
committer | Tobias Markmann <tm@ayena.de> | 2009-11-19 17:53:52 +0100 |
commit | 55df1de9bdfac703203e5659bb7cf172760ef484 (patch) | |
tree | e65da676bceabba8ad622a2b6d3c28b8f5d0953a /plugins | |
parent | 315e7ac799abb96f627be4c5b27648f007b89be7 (diff) | |
parent | 4cac67d580f99530cd401f4b9b7e7f2036697ada (diff) | |
download | prosody-55df1de9bdfac703203e5659bb7cf172760ef484.tar.gz prosody-55df1de9bdfac703203e5659bb7cf172760ef484.zip |
Merge with trunk.
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/mod_bosh.lua | 1 | ||||
-rw-r--r-- | plugins/mod_console.lua | 2 | ||||
-rw-r--r-- | plugins/mod_register.lua | 4 |
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 |