Diff

plugins/mod_saslauth.lua @ 3066:5e5137057b5f

mod_saslauth: Split out cyrus SASL config options into locals, and add support for cyrus_application_name (default: 'prosody')
author Matthew Wild <mwild1@gmail.com>
date Thu, 20 May 2010 11:51:55 +0100
parent 3064:596303990c7c
child 3164:db9def53fe9c
child 3238:362b94fa5a30
line wrap: on
line diff
--- a/plugins/mod_saslauth.lua	Thu May 20 11:32:24 2010 +0100
+++ b/plugins/mod_saslauth.lua	Thu May 20 11:51:55 2010 +0100
@@ -27,7 +27,12 @@
 
 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";
+
+-- Cyrus config options
 local require_provisioning = module:get_option("cyrus_require_provisioning") or false;
+local cyrus_service_realm = module:get_option("cyrus_service_realm");
+local cyrus_service_name = module:get_option("cyrus_service_name");
+local cyrus_application_name = module:get_option("cyrus_application_name");
 
 local log = module._log;
 
@@ -46,7 +51,11 @@
 	if ok then
 		local cyrus_new = cyrus.new;
 		new_sasl = function(realm)
-			return cyrus_new(module:get_option("cyrus_service_realm") or realm, module:get_option("cyrus_service_name") or "xmpp");
+			return cyrus_new(
+				cyrus_service_realm or realm,
+				cyrus_service_name or "xmpp",
+				cyrus_application_name or "prosody"
+			);
 		end
 	else
 		module:log("error", "Failed to load Cyrus SASL because: %s", cyrus);