Comparison

mod_auth_ldap/mod_auth_ldap.lua @ 814:881ec9919144

mod_auth_*: Use module:provides(), and don't explicitly specify provider.name.
author Waqas Hussain <waqas20@gmail.com>
date Thu, 13 Sep 2012 00:08:29 +0500
parent 342:8e9e5c7d97ff
child 902:490cb9161c81
comparison
equal deleted inserted replaced
813:2469f779b3f7 814:881ec9919144
17 for dn, attribs in ld:search(query) do 17 for dn, attribs in ld:search(query) do
18 return true; -- found a result 18 return true; -- found a result
19 end 19 end
20 end 20 end
21 21
22 local provider = { name = "ldap" }; 22 local provider = {};
23 23
24 local function ldap_filter_escape(s) return (s:gsub("[\\*\\(\\)\\\\%z]", function(c) return ("\\%02x"):format(c:byte()) end)); end 24 local function ldap_filter_escape(s) return (s:gsub("[\\*\\(\\)\\\\%z]", function(c) return ("\\%02x"):format(c:byte()) end)); end
25 function provider.test_password(username, password) 25 function provider.test_password(username, password)
26 return do_query({ 26 return do_query({
27 base = ldap_base; 27 base = ldap_base;
51 end 51 end
52 }; 52 };
53 return new_sasl(module.host, testpass_authentication_profile); 53 return new_sasl(module.host, testpass_authentication_profile);
54 end 54 end
55 55
56 module:add_item("auth-provider", provider); 56 module:provides("auth", provider);