Factoring the model user and correcting password
This commit is contained in:
parent
100d143d9a
commit
18ab571416
1 changed files with 12 additions and 0 deletions
|
@ -67,6 +67,18 @@ func get(user User, config *ConfigFile, ldapConn *ldap.Conn) (*User, error) {
|
|||
CanInvite: true,
|
||||
UserEntry: userEntry,
|
||||
}
|
||||
searchReq.BaseDN = config.GroupCanAdmin
|
||||
searchReq.Filter = "(member=" + user.DN + ")"
|
||||
searchRes, err = ldapConn.Search(searchReq)
|
||||
if err != nil {
|
||||
log.Printf("get User : %v", err)
|
||||
log.Printf("get User : %v", searchReq)
|
||||
log.Printf("get User : %v", searchRes)
|
||||
return nil, err
|
||||
}
|
||||
if len(searchRes.Entries) > 0 {
|
||||
resUser.CanAdmin = true
|
||||
}
|
||||
return &resUser, nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue