aboutsummaryrefslogtreecommitdiffstats
path: root/core/usermanager.lua
diff options
context:
space:
mode:
authorJeff Mitchell <jeff@jefferai.org>2010-05-20 14:18:12 -0400
committerJeff Mitchell <jeff@jefferai.org>2010-05-20 14:18:12 -0400
commitc316b28787e59817f0c19725dc524ef6c9f3bb32 (patch)
tree6dd27fc0c448d9dcb662c016dc7f531881c4f36c /core/usermanager.lua
parent29a91eb973059540ade5d3801307f67782bd60d4 (diff)
downloadprosody-c316b28787e59817f0c19725dc524ef6c9f3bb32.tar.gz
prosody-c316b28787e59817f0c19725dc524ef6c9f3bb32.zip
Update usermanager to not crash, etc.
Diffstat (limited to 'core/usermanager.lua')
-rw-r--r--core/usermanager.lua15
1 files changed, 8 insertions, 7 deletions
diff --git a/core/usermanager.lua b/core/usermanager.lua
index a9525ea8..6d43dca9 100644
--- a/core/usermanager.lua
+++ b/core/usermanager.lua
@@ -20,8 +20,15 @@ local require_provisioning = config.get("*", "core", "cyrus_require_provisioning
local prosody = _G.prosody;
+local setmetatable = setmetatable;
+
module "usermanager"
+function new_null_provider()
+ local function dummy() end;
+ return setmetatable({}, { __index = function() return dummy; end });
+end
+
local function host_handler(host)
local host_session = hosts[host];
host_session.events.add_handler("item-added/auth-provider", function (provider)
@@ -32,15 +39,9 @@ local function host_handler(host)
end);
host_session.events.add_handler("item-removed/auth-provider", function (provider)
if host_session.users == provider then
- userplugins.new_default_provider(host);
+ host_session.users = new_null_provider();
end
end);
- if host_session.users ~= nil then
- log("debug", "using non-default authentication provider");
- else
- log("debug", "using default authentication provider");
- 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);