1
0
mirror of https://gitlab.crans.org/nounous/ghostream.git synced 2024-12-22 16:12:19 +00:00

Log the LDAP connection

This commit is contained in:
Yohann D'ANELLO 2021-01-08 22:56:19 +01:00
parent ee16bf9e21
commit 79f52ed880
Signed by: ynerant
GPG Key ID: 3A75C55819C8CF85

View File

@ -42,8 +42,10 @@ func (a LDAP) Login(username string, password string) (bool, string, error) {
for _, username := range potentialUsernames { for _, username := range potentialUsernames {
// Try to bind as user // Try to bind as user
bindDn := "cn=" + username + "," + a.Cfg.UserDn bindDn := "cn=" + username + "," + a.Cfg.UserDn
log.Printf("[LDAP] Logging to %s...", bindDn)
err = a.Conn.Bind(bindDn, password) err = a.Conn.Bind(bindDn, password)
if err == nil { if err == nil {
log.Printf("[LDAP] Logging failed: %s", err)
// Login succeeded if no error // Login succeeded if no error
return true, aliasSplit[0], nil return true, aliasSplit[0], nil
} }