aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_register.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2008-12-29 23:36:24 +0000
committerMatthew Wild <mwild1@gmail.com>2008-12-29 23:36:24 +0000
commitec14708723f359467c1ef8ab4483bb7a96d261ac (patch)
tree761971561e6af89df6525f17168d7c4bd86fb6a8 /plugins/mod_register.lua
parentab1dfc9541f1b87bdfff77da06713f713c7f8db3 (diff)
downloadprosody-ec14708723f359467c1ef8ab4483bb7a96d261ac.tar.gz
prosody-ec14708723f359467c1ef8ab4483bb7a96d261ac.zip
Add allow_registration option to disable account registration
Diffstat (limited to 'plugins/mod_register.lua')
-rw-r--r--plugins/mod_register.lua5
1 files changed, 4 insertions, 1 deletions
diff --git a/plugins/mod_register.lua b/plugins/mod_register.lua
index 120faeab..377bf153 100644
--- a/plugins/mod_register.lua
+++ b/plugins/mod_register.lua
@@ -94,7 +94,9 @@ module:add_iq_handler("c2s", "jabber:iq:register", function (session, stanza)
end);
module:add_iq_handler("c2s_unauthed", "jabber:iq:register", function (session, stanza)
- if stanza.tags[1].name == "query" then
+ if config.get(module.host, "core", "allow_registration") == false then
+ session.send(st.error_reply(stanza, "cancel", "service-unavailable"));
+ elseif stanza.tags[1].name == "query" then
local query = stanza.tags[1];
if stanza.attr.type == "get" then
local reply = st.reply(stanza);
@@ -132,3 +134,4 @@ module:add_iq_handler("c2s_unauthed", "jabber:iq:register", function (session, s
session.send(st.error_reply(stanza, "cancel", "service-unavailable"));
end;
end);
+