Mercurial > prosody-hg
diff plugins/mod_register.lua @ 2212:7cb6460b18d8
Merge with trunk.
| author | Tobias Markmann <tm@ayena.de> |
|---|---|
| date | Thu, 19 Nov 2009 17:53:52 +0100 |
| parents | 64872e216e23 |
| children | 67b64995ae1e |
line wrap: on
line diff
--- a/plugins/mod_register.lua Thu Nov 19 17:20:38 2009 +0100 +++ b/plugins/mod_register.lua Thu Nov 19 17:53:52 2009 +0100 @@ -117,7 +117,9 @@ 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
