Design
This commit is contained in:
parent
14a446df71
commit
e41a94e4a7
1 changed files with 1 additions and 2 deletions
3
gpas.go
3
gpas.go
|
@ -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")
|
||||||
|
|
Loading…
Reference in a new issue