usermanager: Handle auth providers for components.

Thu, 13 May 2010 21:18:03 +0500

author
Waqas Hussain <waqas20@gmail.com>
date
Thu, 13 May 2010 21:18:03 +0500
changeset 3036
0714539bcf71
parent 3035
5584c928d1f7
child 3037
0319abdcf04f

usermanager: Handle auth providers for components.

core/usermanager.lua file | annotate | diff | comparison | revisions
--- a/core/usermanager.lua	Wed May 12 23:06:46 2010 +0100
+++ b/core/usermanager.lua	Thu May 13 21:18:03 2010 +0500
@@ -22,7 +22,7 @@
 
 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 @@
 		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
 

mercurial