Mercurial > prosody-modules
comparison mod_auth_ldap/mod_auth_ldap.lua @ 831:0c3638673464
Merge upstream with my local LDAP work
| author | Rob Hoelz <rob@hoelz.ro> |
|---|---|
| date | Tue, 18 Sep 2012 00:31:42 +0200 |
| parents | 881ec9919144 |
| children | 490cb9161c81 |
comparison
equal
deleted
inserted
replaced
| 830:f160166612c2 | 831:0c3638673464 |
|---|---|
| 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); |
