Mercurial > prosody-modules
comparison mod_register_url/mod_register_url.lua @ 408:ee28af887507
mod_register_url: minor fix.
author | Marco Cirillo <maranda@lightwitch.org> |
---|---|
date | Tue, 30 Aug 2011 21:22:47 +0000 |
parents | 1f55e844efeb |
children | df57fa689415 |
comparison
equal
deleted
inserted
replaced
407:41feaf7fd8ac | 408:ee28af887507 |
---|---|
5 local st = require "util.stanza"; | 5 local st = require "util.stanza"; |
6 | 6 |
7 function reg_redirect(event) | 7 function reg_redirect(event) |
8 local ip_wl = module:get_option("registration_whitelist") or { "127.0.0.1" }; | 8 local ip_wl = module:get_option("registration_whitelist") or { "127.0.0.1" }; |
9 local url = module:get_option("registration_url"); | 9 local url = module:get_option("registration_url"); |
10 local no_wl = module:get_option("no_registration_whitelist") or false; | 10 local no_wl = module:get_option_boolean("no_registration_whitelist", false); |
11 if type(no_wl) ~= boolean then no_wl = false end | |
12 local test_ip = false; | 11 local test_ip = false; |
13 | 12 |
14 if not no_wl then | 13 if not no_wl then |
15 for i,ip in ipairs(ip_wl) do | 14 for i,ip in ipairs(ip_wl) do |
16 if event.origin.ip == ip then test_ip = true; end | 15 if event.origin.ip == ip then test_ip = true; end |