From cadf6956dea22b215b9ab2874d3f11af322c2975 Mon Sep 17 00:00:00 2001 From: Waqas Hussain Date: Thu, 13 May 2010 21:18:03 +0500 Subject: usermanager: Handle auth providers for components. --- core/usermanager.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'core') diff --git a/core/usermanager.lua b/core/usermanager.lua index e338ebbd..28e89369 100644 --- a/core/usermanager.lua +++ b/core/usermanager.lua @@ -22,7 +22,7 @@ module "usermanager" local new_default_provider; -prosody.events.add_handler("host-activated", function (host) +local function host_handler(host) local host_session = hosts[host]; host_session.events.add_handler("item-added/auth-provider", function (provider) if config.get(host, "core", "authentication") == provider.name then @@ -35,7 +35,9 @@ prosody.events.add_handler("host-activated", function (host) end end); host_session.users = new_default_provider(host); -- Start with the default usermanager provider -end); +end +prosody.events.add_handler("host-activated", host_handler); +prosody.events.add_handler("component-activated", host_handler); local function is_cyrus(host) return config.get(host, "core", "sasl_backend") == "cyrus"; end -- cgit v1.2.3