Factoring the model user and correcting password
This commit is contained in:
parent
149078bc16
commit
2ce3881bdf
1 changed files with 10 additions and 5 deletions
|
@ -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,
|
||||||
"",
|
"(objectClass=inetOrgPerson)",
|
||||||
[]string{
|
[]string{
|
||||||
"(objectClass=inetOrgPerson)",
|
"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)
|
||||||
|
|
Loading…
Reference in a new issue