mod_saslauth: Pass session to usermanager.get_sasl_handler()
authorMatthew Wild <mwild1@gmail.com>
Wed, 04 Jul 2012 23:44:13 +0100
changeset 4939 0545a574667b
parent 4938 76a960bff4c7
child 4940 39781d4d3173
child 4941 d46948d3018a
mod_saslauth: Pass session to usermanager.get_sasl_handler()
plugins/mod_saslauth.lua
--- a/plugins/mod_saslauth.lua	Wed Jul 04 23:43:18 2012 +0100
+++ b/plugins/mod_saslauth.lua	Wed Jul 04 23:44:13 2012 +0100
@@ -208,7 +208,7 @@
 		session.sasl_handler = nil; -- allow starting a new SASL negotiation before completing an old one
 	end
 	if not session.sasl_handler then
-		session.sasl_handler = usermanager_get_sasl_handler(module.host);
+		session.sasl_handler = usermanager_get_sasl_handler(module.host, session);
 	end
 	local mechanism = stanza.attr.mechanism;
 	if not session.secure and (secure_auth_only or (mechanism == "PLAIN" and not allow_unencrypted_plain_auth)) then
@@ -246,7 +246,7 @@
 		if secure_auth_only and not origin.secure then
 			return;
 		end
-		origin.sasl_handler = usermanager_get_sasl_handler(module.host);
+		origin.sasl_handler = usermanager_get_sasl_handler(module.host, origin);
 		local mechanisms = st.stanza("mechanisms", mechanisms_attr);
 		for mechanism in pairs(origin.sasl_handler:mechanisms()) do
 			if mechanism ~= "PLAIN" or origin.secure or allow_unencrypted_plain_auth then