correct lua syntax

This commit is contained in:
Sebastian Hugentobler 2018-02-27 14:52:38 +01:00
parent 436e666ed2
commit 90f4ac4cff

View File

@ -15,7 +15,7 @@ function auth_passdb_lookup(req)
local username = req.username
local ldap_pass_filter = "{{ getenv "LDAP_PASS_FILTER" }}"
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
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,
ldap_use_tls)
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
else