diff --git a/src/images/sharky_vector_svg.svg b/src/images/sharky.svg similarity index 100% rename from src/images/sharky_vector_svg.svg rename to src/images/sharky.svg diff --git a/src/index.html b/src/index.html index e1a60f9..6b38901 100644 --- a/src/index.html +++ b/src/index.html @@ -1,41 +1,43 @@ - - - Skynet - - - - -
- Picture of Sharky, the mascot of skynet -

Skynet Password Reset & Sign-up service

-
-
-

Sign-up Page

-

Please use this if you have yet to activate an account on Skynet before.

-

Change Password

-

Please use this service to change your skynet password

-

User modification

-

- Please use this service to modify your user data (email, login ssh key, etc.) -

-

Forgot your username?

-

- Please use this service to get a reminder email with your skynet username -

-

- Forgot your password? -

-

- Please use this service to reset your password. -

-
- - - + + + Skynet Self Service + + + + +
+ +
+

Sign-up

+

Please use this if you have yet to activate an account on Skynet before.

+

Change Password

+

Please use this service to change your skynet password

+

Account modification

+

+ Please use this service to modify your user data (email, login ssh key, etc.) +

+

Forgot your username?

+

+ Please use this service to get a reminder email with your skynet username +

+

+ Forgot your password? +

+

+ Please use this service to reset your password. +

+
+ +
+ \ No newline at end of file diff --git a/src/modify.html b/src/modify.html index 83dce96..c64736d 100644 --- a/src/modify.html +++ b/src/modify.html @@ -1,105 +1,106 @@ - - - Modify user - - - - -
- Picture of Sharky, the mascot of skynet -

Skynet Password Reset & Sign-up service

-
-
-

User modification page

-

Use this page to modify your account. Please remember to select a field before submitting the form

-
- - - - - - - - - - - - - - - - - - - - -


- -

-
-

-
- - - - + function selectField() { + const field = document.getElementById('field').value; + const value = document.getElementById('value'); + if (field === 'mail') { + value.type = 'email'; + } else { + value.type = 'text'; + } + } + + + + + \ No newline at end of file diff --git a/src/password.html b/src/password.html index 47e67c4..6362e44 100644 --- a/src/password.html +++ b/src/password.html @@ -1,80 +1,81 @@ - - - Password reset - - - - -
- Picture of Sharky, the mascot of skynet -

Skynet Password Reset & Sign-up service

-
-
-

Password Change

-

Please use this page to change your Skynet password.

-
- - - - - - - - - - - - - - - - - - - - -




-
-

-
- - - - + function formHandler(listener) { + listener.preventDefault(); + const formData = new FormData(formEl); + const user = formData.get("user"); + const pass = formData.get("pass"); + const newPW = formData.get("newPW"); + if (newPW === formData.get("newPWConfirm")) { + const object = {user: user, pass: pass, field: "userPassword", value: newPW} + fetch('https://api.account.skynet.ie/ldap/update', { + method: 'POST', + body: JSON.stringify(object), + mode: "cors" + }).then(res => { + if (res.status === 200) { + document.getElementById('formStatus').innerHTML = "Success"; + } else if (res.status === 500) { + document.getElementById('formStatus').innerHTML = "Failure"; + } else { + document.getElementById('formStatus').innerHTML = "Failure: Failed to communicate to server"; + } + }).catch(() => document.getElementById('formStatus').innerHTML = "Please try again"); + } else { + document.getElementById('formStatus').innerHTML = "Failure: new passwords don't match"; + } + } + + + + + diff --git a/src/recovery/password.html b/src/recovery/password.html index 385ac26..b3136f0 100644 --- a/src/recovery/password.html +++ b/src/recovery/password.html @@ -1,92 +1,93 @@ - - - Account Recovery - - - - -
- Picture of Sharky, the mascot of skynet -

Skynet Password Reset & Sign-up service

-
-
-

Forgot Password

-

Please use this page to request a password reset link to your linked email.

-
- - - - - - - - - - - - - - - -

Or

-
-

-
- - - - + if (req.status === 200) { + document.getElementById('formStatus').innerHTML = "Success Please check emails"; + } else { + document.getElementById('formStatus').innerHTML = "Failure: Failed to communicate to server"; + } + } catch (e) { + document.getElementById('formStatus').innerHTML = `Error: ${e}`; + } + } + + + + + diff --git a/src/recovery/password_reset.html b/src/recovery/password_reset.html index 10c4d04..7fcfa26 100644 --- a/src/recovery/password_reset.html +++ b/src/recovery/password_reset.html @@ -1,73 +1,83 @@ - - - Password recovery - - -

Password Recovery

-

Please enter a new password for your skynet account below

-
- -
- -
- -
-

- - - - + let data = req.json(); + if (data.result === 'error') { + document.getElementById('formStatus').innerHTML = `${data.error}`; + } else { + document.getElementById('formStatus').innerHTML = "Success"; + } + } + + + + + diff --git a/src/recovery/ssh-request.html b/src/recovery/ssh-request.html index 6c60ec2..e6ab366 100644 --- a/src/recovery/ssh-request.html +++ b/src/recovery/ssh-request.html @@ -1,64 +1,74 @@ - - - SSH key recovery - - -

SSH key recovery

-
- -
- -
- -
-

- - - - + function json(temp) { + if (temp) { + if (temp.result === 'error') { + document.getElementById('formStatus').innerHTML = `${temp.error}`; + } else { + document.getElementById('formStatus').innerHTML = "Success"; + } + } + } + + + + + \ No newline at end of file diff --git a/src/recovery/username.html b/src/recovery/username.html index 44448e3..4d60151 100644 --- a/src/recovery/username.html +++ b/src/recovery/username.html @@ -1,60 +1,65 @@ - - - Forgot Username - - - - -
- Picture of Sharky, the mascot of skynet -

Skynet Password Reset & Sign-up service

-
-
-

Forgot Username

-

Please use this page to get a reminder email with your skynet username in it.

-
- - - - - - - - -

-
-

-
- - - - + function formHandler(listener) { + listener.preventDefault(); + const formData = new FormData(formEl); + const email = formData.get("email"); + const object = {email: email}; + fetch('https://api.account.skynet.ie/ldap/recover/username', { + method: 'POST', + body: JSON.stringify(object), + mode: "cors" + }).then(res => { + if (res.status === 200) { + document.getElementById('formStatus').innerHTML = "Success"; + } else if (res.status === 500) { + document.getElementById('formStatus').innerHTML = "Failure"; + } else { + document.getElementById('formStatus').innerHTML = "Failure: Failed to communicate to server"; + } + }).catch(() => document.getElementById('formStatus').innerHTML = "Please try again"); + } + + + + + diff --git a/src/register.html b/src/register.html index 6a300e2..ba6d186 100644 --- a/src/register.html +++ b/src/register.html @@ -1,89 +1,90 @@ - - - Skynet Register - - - - -
- Picture of Sharky, the mascot of skynet -

Skynet Password Reset & Sign-up service

-
-
-

Register

-

Thank you for signing up for your free skynet account. Please complete the process by filling in the form - below

-
- - - - - - - - - - - - - - - - -


-
-
-

- - - - + + + + + \ No newline at end of file diff --git a/src/signup.html b/src/signup.html index d430a24..7c90be9 100644 --- a/src/signup.html +++ b/src/signup.html @@ -1,95 +1,96 @@ - - - Skynet Sign-up - - - - - -
- Picture of Sharky, the mascot of skynet -

Skynet Password Reset & Sign-up service

-
-
-

Welcome to Skynet

-

- Skynet is a server cluster that the UL Computer Society runs. If you previously had an account and need to - activate
- it please click here to set a contact email address for your account. IF you are a - new
- user, please fill in the form below with the email that you use on ul wolves. -

-
- -
- -
-

-
- - - - + function formHandler(listener) { + listener.preventDefault(); + //HTML below taken from the W3 schools tutorial () + document.getElementById('formStatus').innerHTML = "
" + const formData = new FormData(formEl); + const email = formData.get("email"); + const object = {email: email}; + fetch('https://api.account.skynet.ie/ldap/new/email', { + method: 'POST', + body: JSON.stringify(object), + mode: "cors" + }).then(res => { + if (res.status === 200) { + document.getElementById('formStatus').innerHTML = "Success"; + } else if (res.status === 500) { + document.getElementById('formStatus').innerHTML = "Failure"; + } else { + document.getElementById('formStatus').innerHTML = "Failure: Failed to communicate to server"; + } + }).catch(() => document.getElementById('formStatus').innerHTML = "Please try again"); + } + + + + + \ No newline at end of file diff --git a/src/stylesheets/index.css b/src/stylesheets/index.css index eea55a1..60e7c15 100644 --- a/src/stylesheets/index.css +++ b/src/stylesheets/index.css @@ -1,28 +1,75 @@ -/* General styling */ + +html { + background: #008B8B url(../images/backgroundsharkycoin.png); + -webkit-font-smoothing: antialiased; +} + body { - background-image: url(../images/backgroundsharkycoin.png); - text-align: center; + text-align: center; + background: #008B8B; + box-shadow: 0 0 2px rgba(0, 0, 0, 0.06); + color: #F0FFFF; + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 16px; + line-height: 1.5; + margin: 0 auto; + max-width: 800px; + padding: 2em 2em 4em; +} + +h1, h2 { + color: #F0FFFF; + font-weight: 600; + line-height: 1.3; +} + +.p1 { + color: #FFFF00 } /* Title bar */ -#title { - display: inline-flex; - background-color: white; - height: auto; +header { + display: inline-flex; + align-items: center; + justify-content: center; + height: auto; } -#title img { - float: left; +header img { + float: left; } .boxes { - display: -moz-flex; - background-color: #008B8B; - margin-left: 20%; - margin-right: 20%; - margin-bottom: 3%; + display: -moz-flex; + background-color: #008B8B; + margin-left: 20%; + margin-right: 20%; + margin-bottom: 3%; } #table { - display: inline; + display: inline; +} + + +/* +Sticky Footer +https://developer.mozilla.org/en-US/docs/Web/CSS/Layout_cookbook/Sticky_footers +*/ +html, body { + box-sizing: border-box; + height: 100%; +} +.wrapper { + box-sizing: border-box; + min-height: 100%; + display: flex; + flex-direction: column; +} +.page-header, .page-footer { + flex-grow: 0; + flex-shrink: 0; +} +.page-body { + flex-grow: 1; } \ No newline at end of file