Mercurial > prosody-modules
comparison mod_register_redirect/mod_register_redirect.lua @ 722:5c7175be532b
mod_register_redirect: referenced configmanager from prosody's global space instead of requiring it (==).
author | Marco Cirillo <maranda@lightwitch.org> |
---|---|
date | Mon, 25 Jun 2012 22:17:40 +0000 |
parents | 3cc17ef98be0 |
children | 055b9ea7bd68 |
comparison
equal
deleted
inserted
replaced
721:9080b0898b6f | 722:5c7175be532b |
---|---|
4 -- Registration Redirect module for Prosody | 4 -- Registration Redirect module for Prosody |
5 -- | 5 -- |
6 -- Redirects IP addresses not in the whitelist to a web page or another method to complete the registration. | 6 -- Redirects IP addresses not in the whitelist to a web page or another method to complete the registration. |
7 | 7 |
8 local st = require "util.stanza" | 8 local st = require "util.stanza" |
9 local cman = require "core.configmanager" | 9 local cman = configmanager |
10 | 10 |
11 function reg_redirect(event) | 11 function reg_redirect(event) |
12 local stanza, origin = event.stanza, event.origin | 12 local stanza, origin = event.stanza, event.origin |
13 local ip_wl = module:get_option("registration_whitelist") or { "127.0.0.1" } | 13 local ip_wl = module:get_option("registration_whitelist") or { "127.0.0.1" } |
14 local url = module:get_option_string("registration_url", nil) | 14 local url = module:get_option_string("registration_url", nil) |