From 5b8c669a182961fb15b98e32e55ca1b995279574 Mon Sep 17 00:00:00 2001 From: Chris Mann Date: Fri, 21 Jul 2023 08:24:57 +0200 Subject: [PATCH] Implementing Activate User --- invite.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/invite.go b/invite.go index 6176446..6cd92ed 100644 --- a/invite.go +++ b/invite.go @@ -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"], "")