plugins/mod_register.lua

changeset 665
09e0e9c722a3
parent 615
4ae3e81513f3
child 690
e901a0709005
--- a/plugins/mod_register.lua	Mon Dec 29 22:31:10 2008 +0000
+++ b/plugins/mod_register.lua	Mon Dec 29 23:36:24 2008 +0000
@@ -94,7 +94,9 @@
 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 @@
 		session.send(st.error_reply(stanza, "cancel", "service-unavailable"));
 	end;
 end);
+

mercurial