mirror of
https://gitlab.crans.org/nounous/ghostream.git
synced 2024-12-22 10:22:19 +00:00
Log the LDAP connection
This commit is contained in:
parent
ee16bf9e21
commit
79f52ed880
@ -42,8 +42,10 @@ func (a LDAP) Login(username string, password string) (bool, string, error) {
|
||||
for _, username := range potentialUsernames {
|
||||
// Try to bind as user
|
||||
bindDn := "cn=" + username + "," + a.Cfg.UserDn
|
||||
log.Printf("[LDAP] Logging to %s...", bindDn)
|
||||
err = a.Conn.Bind(bindDn, password)
|
||||
if err == nil {
|
||||
log.Printf("[LDAP] Logging failed: %s", err)
|
||||
// Login succeeded if no error
|
||||
return true, aliasSplit[0], nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user