Diff

plugins/mod_saslauth.lua @ 4361:605045b77bc6

mod_saslauth: Fire authentication-success and authentication-failure events (thanks scitor)
author Matthew Wild <mwild1@gmail.com>
date Mon, 29 Aug 2011 12:01:42 -0400
parent 4078:05a58497a903
child 4392:d2a7a44d68c5
line wrap: on
line diff
--- a/plugins/mod_saslauth.lua	Fri Aug 26 16:02:08 2011 +0500
+++ b/plugins/mod_saslauth.lua	Mon Aug 29 12:01:42 2011 -0400
@@ -48,8 +48,10 @@
 
 local function handle_status(session, status, ret, err_msg)
 	if status == "failure" then
+		module:fire_event("authentication-failure", { session = session, condition = ret, text = err_msg });
 		session.sasl_handler = session.sasl_handler:clean_clone();
 	elseif status == "success" then
+		module:fire_event("authentication-success", { session = session });
 		local username = nodeprep(session.sasl_handler.username);
 
 		local ok, err = sm_make_authenticated(session, session.sasl_handler.username);