liquid_feedback_frontend
diff env/ldap/bind_as_app.lua @ 1071:58f48a8a202a
Imported and merged LDAP patch
author | bsw |
---|---|
date | Fri Jul 18 21:42:59 2014 +0200 (2014-07-18) |
parents | |
children |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/env/ldap/bind_as_app.lua Fri Jul 18 21:42:59 2014 +0200 1.3 @@ -0,0 +1,21 @@ 1.4 +-- binds to configured LDAP server with application's credentials 1.5 +-- -------------------------------------------------------------------------- 1.6 +-- 1.7 +-- returns 1.8 +-- ldap_conn: in case of success, an LDAP connection handle 1.9 +-- err: in case of an error, an error code (string) 1.10 + 1.11 +function ldap.bind_as_app() 1.12 + 1.13 + local dn, password 1.14 + 1.15 + if config.ldap.bind_as then 1.16 + dn = config.ldap.bind_as.dn 1.17 + password = config.ldap.bind_as.password 1.18 + end 1.19 + 1.20 + local ldap_conn, err = ldap.bind(dn, password) 1.21 + 1.22 + return ldap_conn, err 1.23 + 1.24 +end