Factoring the model user and correcting password

This commit is contained in:
Chris Mann 2023-07-22 08:43:53 +02:00
parent 149078bc16
commit 2ce3881bdf

View file

@ -33,16 +33,21 @@ func get(user User, config *ConfigFile, ldapConn *ldap.Conn) (*User, error) {
searchReq := ldap.NewSearchRequest( searchReq := ldap.NewSearchRequest(
user.DN, user.DN,
ldap.ScopeBaseObject, ldap.ScopeBaseObject,
0, ldap.NeverDerefAliases,
0, 0,
0, 0,
false, false,
"",
[]string{
"(objectClass=inetOrgPerson)", "(objectClass=inetOrgPerson)",
[]string{
"cn",
"givenName",
"displayName",
"uid",
"sn",
"mail",
"description",
}, },
nil, nil)
)
searchRes, err := ldapConn.Search(searchReq) searchRes, err := ldapConn.Search(searchReq)
if err != nil { if err != nil {
log.Printf("get User : %v", err) log.Printf("get User : %v", err)