From ec14708723f359467c1ef8ab4483bb7a96d261ac Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Mon, 29 Dec 2008 23:36:24 +0000 Subject: Add allow_registration option to disable account registration --- plugins/mod_register.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'plugins/mod_register.lua') 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); + -- cgit v1.2.3