Implementing Activate User

This commit is contained in:
Chris Mann 2023-07-21 08:24:57 +02:00
parent 791f2ce6c2
commit 5b8c669a18

View file

@ -126,13 +126,13 @@ func handleNewAccount(w http.ResponseWriter, r *http.Request, l *ldap.Conn, invi
newUser := NewUser{}
login := checkLogin(w, r)
newUser.CN = strings.TrimSpace(strings.Join(r.Form["username"], "@lesgv.com"))
newUser.CN = fmt.Sprintf("%s@%s", strings.TrimSpace(strings.Join(r.Form["username"], "")), "lesgv.com")
newUser.DisplayName = strings.TrimSpace(strings.Join(r.Form["displayname"], ""))
newUser.GivenName = strings.TrimSpace(strings.Join(r.Form["givenname"], ""))
newUser.SN = strings.TrimSpace(strings.Join(r.Form["surname"], ""))
newUser.UID = strings.TrimSpace(strings.Join(r.Form["username"], ""))
newUser.Mail = strings.TrimSpace(strings.Join(r.Form["mail"], ""))
newUser.DN = "cn=" + strings.TrimSpace(strings.Join(r.Form["username"], "@lesgv.com")) + "," + config.InvitationBaseDN
newUser.DN = "cn=" + newUser.CN + "," + config.InvitationBaseDN
password1 := strings.Join(r.Form["password"], "")
password2 := strings.Join(r.Form["password2"], "")