Front-End Stuff

This commit is contained in:
Chris Mann 2023-07-20 15:40:14 +02:00
parent d7633797c2
commit 0caf79a96a
2 changed files with 16 additions and 1 deletions

View file

@ -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)

View file

@ -10,4 +10,17 @@ function addResDigitaOrgIdValue () {
function addResDigitaOrgMail () {
document.getElementById("idvalue").value = addResDigitaOrg("mail");
}
document.getElementById("idvalue").addEventListener("change",addResDigitaOrgIdValue);
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);
}