Factoring the model user and correcting password
This commit is contained in:
parent
4186942162
commit
e247d4b434
2 changed files with 8 additions and 6 deletions
|
@ -166,7 +166,7 @@ func replaceIfContent(modifReq *ldap.ModifyRequest, key string, value string, pr
|
|||
if value != "" {
|
||||
modifReq.Replace(key, []string{value})
|
||||
} else {
|
||||
modifReq.Delete(key, []string{value})
|
||||
modifReq.Delete(key, []string{previousValue})
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
|
@ -59,12 +59,14 @@ func handleProfile(w http.ResponseWriter, r *http.Request) {
|
|||
data.GivenName = user.GivenName
|
||||
data.Surname = user.SN
|
||||
data.Description = user.Description
|
||||
if user.Mail != "" {
|
||||
err := modify(user, config, login.conn)
|
||||
if err != nil {
|
||||
data.ErrorMessage = "handleProfile : " + err.Error()
|
||||
} else {
|
||||
data.Success = true
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
visible := strings.TrimSpace(strings.Join(r.Form["visibility"], ""))
|
||||
|
|
Loading…
Reference in a new issue