Merge with 0.5

Tue, 29 Sep 2009 19:56:23 +0100

author
Matthew Wild <mwild1@gmail.com>
date
Tue, 29 Sep 2009 19:56:23 +0100
changeset 1847
1842da566c7d
parent 1845
e52dbae3c05d (current diff)
parent 1846
fdb43fc1bafc (diff)
child 1853
5da0e3b1f847

Merge with 0.5

plugins/mod_saslauth.lua file | annotate | diff | comparison | revisions
--- a/plugins/mod_saslauth.lua	Tue Sep 29 19:07:17 2009 +0100
+++ b/plugins/mod_saslauth.lua	Tue Sep 29 19:56:23 2009 +0100
@@ -56,14 +56,15 @@
 	if status == "failure" then
 		session.sasl_handler = nil;
 	elseif status == "success" then
-		if not session.sasl_handler.username then -- TODO move this to sessionmanager
+		local username = nodeprep(session.sasl_handler.username);
+		session.sasl_handler = nil;
+		if not username then -- TODO move this to sessionmanager
 			module:log("warn", "SASL succeeded but we didn't get a username!");
 			session.sasl_handler = nil;
 			session:reset_stream();
 			return;
-		end
-		sm_make_authenticated(session, session.sasl_handler.username);
-		session.sasl_handler = nil;
+		end 
+		sm_make_authenticated(session, username);
 		session:reset_stream();
 	end
 end

mercurial