Comparison

core/usermanager.lua @ 3362:90bf162303f3

usermanager: Return a non-nil SASL handler from the null auth provider (fixes a traceback).
author Waqas Hussain <waqas20@gmail.com>
date Wed, 14 Jul 2010 19:49:43 +0500
parent 3336:3a8ce659edfc
child 3395:e736f68c1047
comparison
equal deleted inserted replaced
3361:8d4e7c231d3e 3362:90bf162303f3
14 local ipairs = ipairs; 14 local ipairs = ipairs;
15 local hashes = require "util.hashes"; 15 local hashes = require "util.hashes";
16 local jid_bare = require "util.jid".bare; 16 local jid_bare = require "util.jid".bare;
17 local config = require "core.configmanager"; 17 local config = require "core.configmanager";
18 local hosts = hosts; 18 local hosts = hosts;
19 local sasl_new = require "util.sasl".new;
19 20
20 local require_provisioning = config.get("*", "core", "cyrus_require_provisioning") or false; 21 local require_provisioning = config.get("*", "core", "cyrus_require_provisioning") or false;
21 22
22 local prosody = _G.prosody; 23 local prosody = _G.prosody;
23 24
27 28
28 module "usermanager" 29 module "usermanager"
29 30
30 function new_null_provider() 31 function new_null_provider()
31 local function dummy() end; 32 local function dummy() end;
32 return setmetatable({name = "null"}, { __index = function() return dummy; end }); 33 local function dummy_get_sasl_handler() return sasl_new(nil, {}); end
34 return setmetatable({name = "null", get_sasl_handler = dummy_get_sasl_handler}, { __index = function() return dummy; end });
33 end 35 end
34 36
35 function initialize_host(host) 37 function initialize_host(host)
36 local host_session = hosts[host]; 38 local host_session = hosts[host];
37 host_session.events.add_handler("item-added/auth-provider", function (event) 39 host_session.events.add_handler("item-added/auth-provider", function (event)