Mercurial > prosody-modules
comparison mod_captcha_registration/modules/mod_register.lua @ 2728:11fdfd73a527
mod_captcha_registration: Add ::1 to the default registration_whitelist.
| author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
|---|---|
| date | Sun, 16 Jul 2017 19:27:44 +0100 |
| parents | 985bfc6e8cad |
| children |
comparison
equal
deleted
inserted
replaced
| 2727:91cbeb6ad987 | 2728:11fdfd73a527 |
|---|---|
| 203 end | 203 end |
| 204 | 204 |
| 205 local recent_ips = {}; | 205 local recent_ips = {}; |
| 206 local min_seconds_between_registrations = module:get_option("min_seconds_between_registrations"); | 206 local min_seconds_between_registrations = module:get_option("min_seconds_between_registrations"); |
| 207 local whitelist_only = module:get_option("whitelist_registration_only"); | 207 local whitelist_only = module:get_option("whitelist_registration_only"); |
| 208 local whitelisted_ips = module:get_option("registration_whitelist") or { "127.0.0.1" }; | 208 local whitelisted_ips = module:get_option("registration_whitelist") or { "127.0.0.1", "::1" }; |
| 209 local blacklisted_ips = module:get_option("registration_blacklist") or {}; | 209 local blacklisted_ips = module:get_option("registration_blacklist") or {}; |
| 210 | 210 |
| 211 for _, ip in ipairs(whitelisted_ips) do whitelisted_ips[ip] = true; end | 211 for _, ip in ipairs(whitelisted_ips) do whitelisted_ips[ip] = true; end |
| 212 for _, ip in ipairs(blacklisted_ips) do blacklisted_ips[ip] = true; end | 212 for _, ip in ipairs(blacklisted_ips) do blacklisted_ips[ip] = true; end |
| 213 | 213 |
