Mercurial > prosody-hg
comparison core/usermanager.lua @ 3991:2b86d7705f4e
usermanager: Change dummy provider method to return an error string also (method not implemented)
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Tue, 04 Jan 2011 17:10:56 +0000 |
| parents | a20a41e512f8 |
| children | 73075b004e77 |
comparison
equal
deleted
inserted
replaced
| 3990:764922062c38 | 3991:2b86d7705f4e |
|---|---|
| 22 local default_provider = "internal_plain"; | 22 local default_provider = "internal_plain"; |
| 23 | 23 |
| 24 module "usermanager" | 24 module "usermanager" |
| 25 | 25 |
| 26 function new_null_provider() | 26 function new_null_provider() |
| 27 local function dummy() end; | 27 local function dummy() return nil, "method not implemented"; end; |
| 28 local function dummy_get_sasl_handler() return sasl_new(nil, {}); end | 28 local function dummy_get_sasl_handler() return sasl_new(nil, {}); end |
| 29 return setmetatable({name = "null", get_sasl_handler = dummy_get_sasl_handler}, { __index = function() return dummy; end }); | 29 return setmetatable({name = "null", get_sasl_handler = dummy_get_sasl_handler}, { |
| 30 __index = function(self, method) return dummy; end | |
| 31 }); | |
| 30 end | 32 end |
| 31 | 33 |
| 32 function initialize_host(host) | 34 function initialize_host(host) |
| 33 local host_session = hosts[host]; | 35 local host_session = hosts[host]; |
| 34 if host_session.type ~= "local" then return; end | 36 if host_session.type ~= "local" then return; end |
