Factoring the model user and correcting password

This commit is contained in:
Chris Mann 2023-07-22 13:46:26 +02:00
parent eeba767453
commit 00e2a57c29

View file

@ -157,8 +157,8 @@ func handleNewAccount(w http.ResponseWriter, r *http.Request, l *ldap.Conn, invi
newUser.SN = strings.TrimSpace(strings.Join(r.Form["surname"], "")) newUser.SN = strings.TrimSpace(strings.Join(r.Form["surname"], ""))
newUser.Mail = strings.TrimSpace(strings.Join(r.Form["mail"], "")) newUser.Mail = strings.TrimSpace(strings.Join(r.Form["mail"], ""))
newUser.UID = strings.TrimSpace(strings.Join(r.Form["username"], "")) newUser.UID = strings.TrimSpace(strings.Join(r.Form["username"], ""))
newUser.CN = strings.TrimSpace(strings.Join(r.Form["CN"], "")) newUser.CN = strings.TrimSpace(strings.Join(r.Form["cn"], ""))
newUser.DN = "cn=" + newUser.CN + "," + config.InvitationBaseDN newUser.DN = "cn=" + strings.TrimSpace(strings.Join(r.Form["cn"], "")) + "," + config.InvitationBaseDN
password1 := strings.Join(r.Form["password"], "") password1 := strings.Join(r.Form["password"], "")
password2 := strings.Join(r.Form["password2"], "") password2 := strings.Join(r.Form["password2"], "")