Merge with Paul

Sun, 03 Jan 2010 17:54:26 +0000

author
Matthew Wild <mwild1@gmail.com>
date
Sun, 03 Jan 2010 17:54:26 +0000
changeset 2417
70f65a48f05e
parent 2416
89be536aae25 (current diff)
parent 2415
eb383f58624b (diff)
child 2418
c35deaea53b9

Merge with Paul

--- a/plugins/mod_saslauth.lua	Sun Jan 03 17:53:54 2010 +0000
+++ b/plugins/mod_saslauth.lua	Sun Jan 03 17:54:26 2010 +0000
@@ -25,7 +25,8 @@
 local md5 = require "util.hashes".md5;
 local config = require "core.configmanager";
 
-local secure_auth_only = config.get(module:get_host(), "core", "c2s_require_encryption") or config.get(module:get_host(), "core", "require_encryption");
+local secure_auth_only = module:get_option("c2s_require_encryption") or module:get_option("require_encryption");
+local sasl_backend = module:get_option("sasl_backend") or "builtin";
 
 local log = module._log;
 
@@ -34,12 +35,13 @@
 local xmlns_stanzas ='urn:ietf:params:xml:ns:xmpp-stanzas';
 
 local new_sasl
-if config.get(module:get_host(), "core", "cyrus_service_name") then
+if sasl_backend == "cyrus" then
 	cyrus_new = require "util.sasl_cyrus".new;
 	new_sasl = function(realm)
-			return cyrus_new(realm, config.get(module:get_host(), "core", "cyrus_service_name"))
+			return cyrus_new(realm, module:get_option("cyrus_service_name") or "xmpp")
 		end
 else
+	if sasl_backend ~= "backend" then log("warning", "Unknown SASL backend %s", sasl_backend) end;
 	new_sasl = require "util.sasl".new;
 end
 

mercurial