Software /
code /
prosody-modules
Comparison
mod_auth_ldap/mod_auth_ldap.lua @ 1610:062ed39a1805
mod_auth_ldap: Fix nil traceback when using uninitialized LDAP connection.
author | Waqas Hussain <waqas20@gmail.com> |
---|---|
date | Fri, 13 Feb 2015 10:44:23 -0500 |
parent | 1609:5f139770061e |
child | 1611:770236ea9678 |
comparison
equal
deleted
inserted
replaced
1609:5f139770061e | 1610:062ed39a1805 |
---|---|
49 return dn, attr; | 49 return dn, attr; |
50 end | 50 end |
51 | 51 |
52 local function get_user(username) | 52 local function get_user(username) |
53 module:log("debug", "get_user(%q)", username); | 53 module:log("debug", "get_user(%q)", username); |
54 for dn, attr in ld:search({ | 54 for dn, attr in ldap_search({ |
55 base = ldap_base; | 55 base = ldap_base; |
56 scope = ldap_scope; | 56 scope = ldap_scope; |
57 sizelimit = 1; | 57 sizelimit = 1; |
58 filter = ldap_filter:gsub("%$(%a+)", { | 58 filter = ldap_filter:gsub("%$(%a+)", { |
59 user = ldap_filter_escape(username); | 59 user = ldap_filter_escape(username); |
60 host = host; | 60 host = host; |
61 }); | 61 }); |
62 }) do return dn, attr; end | 62 }, 3) do return dn, attr; end |
63 end | 63 end |
64 | 64 |
65 local provider = {}; | 65 local provider = {}; |
66 | 66 |
67 function provider.create_user(username, password) | 67 function provider.create_user(username, password) |