Factoring the model user and correcting password

This commit is contained in:
Chris Mann 2023-07-22 09:52:34 +02:00
parent e247d4b434
commit 2f68cfda0a

View file

@ -55,10 +55,7 @@ func handleProfile(w http.ResponseWriter, r *http.Request) {
Description: strings.TrimSpace(strings.Join(r.Form["description"], "")),
// Password: ,
}
data.DisplayName = user.DisplayName
data.GivenName = user.GivenName
data.Surname = user.SN
data.Description = user.Description
if user.Mail != "" {
err := modify(user, config, login.conn)
if err != nil {
@ -66,6 +63,15 @@ func handleProfile(w http.ResponseWriter, r *http.Request) {
} else {
data.Success = true
}
} else {
user, _ = get(User{
DN: login.Info.DN
}, config, login.conn)
data.DisplayName = user.DisplayName
data.GivenName = user.GivenName
data.Surname = user.SN
data.Description = user.Description
data.Mail = user.Mail
}
/*