liquid_feedback_frontend
annotate env/ldap/bind_as_app.lua @ 1319:00612e1ca36a
Allow external registration cancel target
| author | bsw |
|---|---|
| date | Wed Aug 01 17:52:52 2018 +0200 (2018-08-01) |
| parents | 58f48a8a202a |
| children |
| rev | line source |
|---|---|
| bsw@1071 | 1 -- binds to configured LDAP server with application's credentials |
| bsw@1071 | 2 -- -------------------------------------------------------------------------- |
| bsw@1071 | 3 -- |
| bsw@1071 | 4 -- returns |
| bsw@1071 | 5 -- ldap_conn: in case of success, an LDAP connection handle |
| bsw@1071 | 6 -- err: in case of an error, an error code (string) |
| bsw@1071 | 7 |
| bsw@1071 | 8 function ldap.bind_as_app() |
| bsw@1071 | 9 |
| bsw@1071 | 10 local dn, password |
| bsw@1071 | 11 |
| bsw@1071 | 12 if config.ldap.bind_as then |
| bsw@1071 | 13 dn = config.ldap.bind_as.dn |
| bsw@1071 | 14 password = config.ldap.bind_as.password |
| bsw@1071 | 15 end |
| bsw@1071 | 16 |
| bsw@1071 | 17 local ldap_conn, err = ldap.bind(dn, password) |
| bsw@1071 | 18 |
| bsw@1071 | 19 return ldap_conn, err |
| bsw@1071 | 20 |
| bsw@1071 | 21 end |