[Modify user] Refactoring email change page to be a general modify page

#1
This commit is contained in:
eoghan.conlon 2023-07-29 23:26:41 +01:00
parent 13270f2f4e
commit e689c05fca

View file

@ -2,7 +2,7 @@
<html lang="en-ie"> <html lang="en-ie">
<head> <head>
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<title>Email change</title> <title>Modify user</title>
<link rel="icon" type="image/png" href="images/favicon/favicon-16x16.png" /> <link rel="icon" type="image/png" href="images/favicon/favicon-16x16.png" />
</head> </head>
<body> <body>
@ -11,8 +11,14 @@
<input type="text" id="user" name="user" /> <br /> <input type="text" id="user" name="user" /> <br />
<label for="pass">Password</label> <label for="pass">Password</label>
<input type="password" id="pass" name="pass" /> <br /> <input type="password" id="pass" name="pass" /> <br />
<label for="newEmail">New email</label> <label for="field">Field</label>
<input type="email" id="newEmail" name="newPW" /> <br /> <select id="field">
<option value="" selected="selected">Please select an option</option>
<option value="email">Email</option>
</select>
<br />
<label for="value">Value</label>
<input type="text" id="value" name="value" /> <br />
<input type="Submit" value="Submit" /> <input type="Submit" value="Submit" />
</form> </form>
<p id="formStatus"></p> <p id="formStatus"></p>
@ -28,7 +34,7 @@
const formData = new FormData(formEl); const formData = new FormData(formEl);
const user = formData.get("user"); const user = formData.get("user");
const pass = formData.get("pass"); const pass = formData.get("pass");
const newEmail = formData.get("newEmail"); const newEmail = formData.get("value");
const object = {user: user, pass: pass, field: "mail", value: newEmail} const object = {user: user, pass: pass, field: "mail", value: newEmail}
fetch('https://api.sso.skynet.ie/ldap/update', { fetch('https://api.sso.skynet.ie/ldap/update', {
method: 'POST', method: 'POST',