Factoring the model user and correcting password
This commit is contained in:
parent
60ddadbfc5
commit
cc671507ac
1 changed files with 2 additions and 2 deletions
|
@ -164,11 +164,11 @@ func bind(user User, config *ConfigFile, ldapConn *ldap.Conn) error {
|
||||||
return ldapConn.Bind(user.DN, user.Password)
|
return ldapConn.Bind(user.DN, user.Password)
|
||||||
}
|
}
|
||||||
|
|
||||||
func replaceIfContent(modifReq *ldap.ModifyRequest, key string, value string, previousValue string) error {
|
func replaceIfContent(modifReq *ldap.ModifyRequest, key string, value string, previousValue []string) error {
|
||||||
if value != "" {
|
if value != "" {
|
||||||
modifReq.Replace(key, []string{value})
|
modifReq.Replace(key, []string{value})
|
||||||
} else {
|
} else {
|
||||||
modifReq.Delete(key, []string{previousValue})
|
modifReq.Delete(key, previousValue)
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue