Diff

util/sasl_cyrus.lua @ 2393:1572be348f88

util.sasl_cyrus: Initializing Cyrus SASL library and a bit cleanup.
author Tobias Markmann <tm@ayena.de>
date Tue, 22 Dec 2009 20:55:35 +0100
parent 2392:8777831706d9
child 2394:a2972f9fda6d
line wrap: on
line diff
--- a/util/sasl_cyrus.lua	Tue Dec 22 20:21:44 2009 +0100
+++ b/util/sasl_cyrus.lua	Tue Dec 22 20:55:35 2009 +0100
@@ -31,17 +31,7 @@
 local mechanisms = {};
 local backend_mechanism = {};
 
--- register a new SASL mechanims
-local function registerMechanism(name, backends, f)
-	assert(type(name) == "string", "Parameter name MUST be a string.");
-	assert(type(backends) == "string" or type(backends) == "table", "Parameter backends MUST be either a string or a table.");
-	assert(type(f) == "function", "Parameter f MUST be a function.");
-	mechanisms[name] = f
-	for _, backend_name in ipairs(backends) do
-		if backend_mechanism[backend_name] == nil then backend_mechanism[backend_name] = {}; end
-		t_insert(backend_mechanism[backend_name], name);
-	end
-end
+pcall(cyrussasl.server_init, "prosody")
 
 -- create a new SASL object which can be used to authenticate clients
 function new(realm, service_name)