This commit is contained in:
Chris Mann 2023-07-23 08:25:52 +02:00
parent 14a446df71
commit e41a94e4a7

View file

@ -35,9 +35,8 @@ func passwordLost(user User, config *ConfigFile, ldapConn *ldap.Conn) error {
} }
searchReq := ldap.NewSearchRequest(config.UserBaseDN, ldap.ScopeBaseObject, ldap.NeverDerefAliases, 0, 0, false, "(|()()())", []string{"cn", "uid", "mail", "carLicense"}, nil) searchReq := ldap.NewSearchRequest(config.UserBaseDN, ldap.ScopeBaseObject, ldap.NeverDerefAliases, 0, 0, false, "(|()()())", []string{"cn", "uid", "mail", "carLicense"}, nil)
searchRes, err := ldapConn.Search(searchReq) searchRes, err := ldapConn.Search(searchReq)
err = l.Bind(config.NewUserDN, config.NewUserPassword)
if err != nil { if err != nil {
log.Printf(fmt.Sprintf("passwordLost : %v %v", err, l)) log.Printf(fmt.Sprintf("passwordLost : %v %v", err, ldapConn))
} }
if len(searchRes.Entries) == 0 { if len(searchRes.Entries) == 0 {
return errors.New("Il n'y a pas d'utilisateur qui correspond") return errors.New("Il n'y a pas d'utilisateur qui correspond")