aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Aurich <paul@darkrain42.org>2010-01-02 20:03:24 -0800
committerPaul Aurich <paul@darkrain42.org>2010-01-02 20:03:24 -0800
commit90edd26fd4f7abe9578e4950c610b9004d21bfb8 (patch)
treeb72b69594391d894160920e2da764a84d2a5eb2e
parent3f619ace4b549d613bdd19d13a6f8e81226aaa29 (diff)
downloadprosody-90edd26fd4f7abe9578e4950c610b9004d21bfb8.tar.gz
prosody-90edd26fd4f7abe9578e4950c610b9004d21bfb8.zip
mod_saslauth: Add sasl_backend config parameter
-rw-r--r--plugins/mod_saslauth.lua6
1 files changed, 4 insertions, 2 deletions
diff --git a/plugins/mod_saslauth.lua b/plugins/mod_saslauth.lua
index 92853522..e64eff01 100644
--- a/plugins/mod_saslauth.lua
+++ b/plugins/mod_saslauth.lua
@@ -26,6 +26,7 @@ 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 sasl_backend = config.get(module:get_host(), "core", "sasl_backend") or "builtin";
local log = module._log;
@@ -34,12 +35,13 @@ local xmlns_bind ='urn:ietf:params:xml:ns:xmpp-bind';
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, config.get(module:get_host(), "core", "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