Diff

util/sasl_cyrus.lua @ 3468:d50e2c937717

mod_saslauth, mod_auth_cyrus, util.sasl_cyrus: Moved cyrus account provisioning check out of mod_saslauth.
author Waqas Hussain <waqas20@gmail.com>
date Mon, 23 Aug 2010 16:54:56 +0500
parent 3467:c9f4c3aa14a1
child 3549:395d5bb5266e
line wrap: on
line diff
--- a/util/sasl_cyrus.lua	Mon Aug 23 16:42:27 2010 +0500
+++ b/util/sasl_cyrus.lua	Mon Aug 23 16:54:56 2010 +0500
@@ -143,6 +143,9 @@
 	self.username = cyrussasl.get_username(self.cyrus)
 
 	if (err == 0) then -- SASL_OK
+		if self.require_provisioning and not self.require_provisioning(self.username) then
+			return "failure", "not-authorized", "User authenticated successfully, but not provisioned for XMPP";
+		end
 		return "success", data
 	elseif (err == 1) then -- SASL_CONTINUE
 		return "challenge", data