Changeset

1187:645846375a7b

Merge with 0.4
author Matthew Wild <mwild1@gmail.com>
date Tue, 19 May 2009 13:07:13 +0100
parents 1185:c68ccb7faeaf (current diff) 1186:078eb3b109e9 (diff)
children 1188:fa48e69c4786
files
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/mod_saslauth.lua	Tue May 19 11:56:52 2009 +0100
+++ b/plugins/mod_saslauth.lua	Tue May 19 13:07:13 2009 +0100
@@ -79,8 +79,10 @@
 local function sasl_handler(session, stanza)
 	if stanza.name == "auth" then
 		-- FIXME ignoring duplicates because ejabberd does
-		if config.get(session.host or "*", "core", "anonymous_login") and stanza.attr.mechanism ~= "ANONYMOUS" then
-			return session.send(build_reply("failure", "invalid-mechanism"));
+		if config.get(session.host or "*", "core", "anonymous_login") then
+			if stanza.attr.mechanism ~= "ANONYMOUS" then
+				return session.send(build_reply("failure", "invalid-mechanism"));
+			end
 		elseif stanza.attr.mechanism == "ANONYMOUS" then
 			return session.send(build_reply("failure", "mechanism-too-weak"));
 		end