Comparison

plugins/mod_auth_internal_plain.lua @ 5117:2c7e1ce8f482

mod_auth_*: Use module:provides().
author Waqas Hussain <waqas20@gmail.com>
date Wed, 12 Sep 2012 21:41:51 +0500
parent 5115:3939960b3c07
child 5156:6b08c922a2e4
comparison
equal deleted inserted replaced
5116:5f9066db1b4d 5117:2c7e1ce8f482
13 13
14 local log = module._log; 14 local log = module._log;
15 local host = module.host; 15 local host = module.host;
16 16
17 -- define auth provider 17 -- define auth provider
18 local provider = { name = "internal_plain" }; 18 local provider = {};
19 log("debug", "initializing internal_plain authentication provider for host '%s'", host); 19 log("debug", "initializing internal_plain authentication provider for host '%s'", host);
20 20
21 function provider.test_password(username, password) 21 function provider.test_password(username, password)
22 log("debug", "test password '%s' for user %s at host %s", password, username, host); 22 log("debug", "test password '%s' for user %s at host %s", password, username, host);
23 local credentials = datamanager.load(username, host, "accounts") or {}; 23 local credentials = datamanager.load(username, host, "accounts") or {};
76 end 76 end
77 }; 77 };
78 return new_sasl(host, getpass_authentication_profile); 78 return new_sasl(host, getpass_authentication_profile);
79 end 79 end
80 80
81 module:add_item("auth-provider", provider); 81 module:provides("auth", provider);
82 82