correct lua syntax
This commit is contained in:
parent
436e666ed2
commit
90f4ac4cff
@ -15,7 +15,7 @@ function auth_passdb_lookup(req)
|
|||||||
local username = req.username
|
local username = req.username
|
||||||
local ldap_pass_filter = "{{ getenv "LDAP_PASS_FILTER" }}"
|
local ldap_pass_filter = "{{ getenv "LDAP_PASS_FILTER" }}"
|
||||||
local ldap_pass_filter_formatted = ldap_pass_filter:gsub("%%u", username)
|
local ldap_pass_filter_formatted = ldap_pass_filter:gsub("%%u", username)
|
||||||
local ldap_base_dn = {{ getenv "LDAP_BASE_DN" }}
|
local ldap_base_dn = "{{ getenv "LDAP_BASE_DN" }}"
|
||||||
|
|
||||||
local user_count = 0
|
local user_count = 0
|
||||||
for dn, attribs in ld:search { base = ldap_base_dn, scope = "subtree", filter = ldap_pass_filter_formatted } do
|
for dn, attribs in ld:search { base = ldap_base_dn, scope = "subtree", filter = ldap_pass_filter_formatted } do
|
||||||
@ -38,7 +38,7 @@ function auth_passdb_lookup(req)
|
|||||||
user_password,
|
user_password,
|
||||||
ldap_use_tls)
|
ldap_use_tls)
|
||||||
if test_conn ~= nil then
|
if test_conn ~= nil then
|
||||||
return dovecot.auth.PASSDB_RESULT_OK, string.format("%s=user", ldap_user_attribute))
|
return dovecot.auth.PASSDB_RESULT_OK, string.format("%s=user", ldap_user_attribute)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user