Software / code / prosody
Comparison
plugins/mod_register.lua @ 7570:c61ea328fac2
mod_register: Fix inverted throttle check (fixes #724)
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Sat, 13 Aug 2016 15:42:57 +0200 |
| parent | 7293:c4af754d1e1b |
| child | 7709:0af1783d1592 |
comparison
equal
deleted
inserted
replaced
| 7569:a15ce0014ac9 | 7570:c61ea328fac2 |
|---|---|
| 224 log("debug", "User's IP not known; can't apply blacklist/whitelist"); | 224 log("debug", "User's IP not known; can't apply blacklist/whitelist"); |
| 225 elseif blacklisted_ips[session.ip] or (whitelist_only and not whitelisted_ips[session.ip]) then | 225 elseif blacklisted_ips[session.ip] or (whitelist_only and not whitelisted_ips[session.ip]) then |
| 226 session.send(st.error_reply(stanza, "cancel", "not-acceptable", "You are not allowed to register an account.")); | 226 session.send(st.error_reply(stanza, "cancel", "not-acceptable", "You are not allowed to register an account.")); |
| 227 return true; | 227 return true; |
| 228 elseif min_seconds_between_registrations and not whitelisted_ips[session.ip] then | 228 elseif min_seconds_between_registrations and not whitelisted_ips[session.ip] then |
| 229 if check_throttle(session.ip) then | 229 if not check_throttle(session.ip) then |
| 230 session.send(st.error_reply(stanza, "wait", "not-acceptable")); | 230 session.send(st.error_reply(stanza, "wait", "not-acceptable")); |
| 231 return true; | 231 return true; |
| 232 end | 232 end |
| 233 end | 233 end |
| 234 local username, password = nodeprep(data.username), data.password; | 234 local username, password = nodeprep(data.username), data.password; |