diff --git a/invite.go b/invite.go index 55b33f8..402fd50 100644 --- a/invite.go +++ b/invite.go @@ -142,9 +142,11 @@ func handleNewAccount(w http.ResponseWriter, r *http.Request, l *ldap.Conn, invi } else { newUser.Password = password2 data.Success = addNewUser(newUser, config, login) + http.Redirect(w, r, "/admin/ldap/"+newUser.DN, http.StatusFound) } // tryCreateAccount(l, data, password1, password2, invitedBy) + } templateInviteNewAccount.Execute(w, data) diff --git a/static/javascript/lesgv.js b/static/javascript/lesgv.js index 512a619..9c8d193 100644 --- a/static/javascript/lesgv.js +++ b/static/javascript/lesgv.js @@ -10,4 +10,17 @@ function addResDigitaOrgIdValue () { function addResDigitaOrgMail () { document.getElementById("idvalue").value = addResDigitaOrg("mail"); } -document.getElementById("idvalue").addEventListener("change",addResDigitaOrgIdValue); \ No newline at end of file +let idvalueInput = document.querySelector("#idvalue"); +if (idvalueInput != null) { + idvalueInput.addEventListener("change",addResDigitaOrgIdValue); +} + + +function changeUsername () { + username = document.getElementById("username"); + calcCn = document.getElementById("calc-cn"); + calcCn.innerText = "Login Name et Courriel seront : " + username.value.split("@")[0] + "@lesgv.com"; +} +if (document.getElementById("username") != null) { + document.getElementById("username").addEventListener("change",changeUsername); +}