diff --git a/admin/index.php b/admin/index.php index 4d91c7c..3f51278 100644 --- a/admin/index.php +++ b/admin/index.php @@ -94,13 +94,19 @@ session_start();
This link will take you back to your account
"; + echo "Or, you will be re-directed automatically in 5 seconds...
"; + echo ""; + } else { + // Or tell them something fucked up + echo "There was a problem and your password couldn't be updated. Make sure you've typed your old password correctly and try again
"; + echo "This link will take you back to your account
"; + echo "Or, you will be re-directed automatically in 5 seconds...
"; + echo ""; + } + + + + + } catch (PDOException $e) { // failed connection + echo "Connection failed: " . $e->getMessage(); + } + + $conn = null; + + ?> + + + \ No newline at end of file diff --git a/scripts/user_management.js b/scripts/user_management.js index d7983aa..8fff5a2 100644 --- a/scripts/user_management.js +++ b/scripts/user_management.js @@ -86,6 +86,25 @@ function passwordConfirm() { } } +function passwordConfirmLite() { + // This is used when we don't have enough space for the "matches" text, i.e. the user page + // Check if the 'confirm' password matches the main one entered + var password = document.getElementById("password").value; + var confirmPassword = document.getElementById("confirmPassword").value; + + // If the field is empty we'll hide the results + if (confirmPassword == "") { + document.getElementById("confirmPassword").style.border = null; + return false; + } else if (password == confirmPassword) { // If they match + document.getElementById("confirmPassword").style.border = "1px solid green"; + return true; + } else if (password != confirmPassword) { + document.getElementById("confirmPassword").style.border = "2px solid red"; + return false; + } +} + function usernameConfirm() { // Get the username entered and convert to lower case var username = document.getElementById("username").value.toLowerCase(); @@ -125,4 +144,29 @@ function checkPasswordRequirements() { } else { document.getElementById("password").style.border = "1px solid green"; } -} \ No newline at end of file +} + +function togglePWChange() { + var socialsDiv = document.getElementById("accountSocialsPanel"); + + var pwChangeDiv = document.getElementById("passwordChangePanel"); + + if (pwChangeDiv.style.display == "none") { + socialsDiv.style.display = "none"; + socialsDiv.style.zIndex = "-1"; + pwChangeDiv.style.display = "flex"; + pwChangeDiv.style.zIndex = "1"; + } else if (pwChangeDiv.style.display == "flex") { + socialsDiv.style.display = "flex"; + socialsDiv.style.zIndex = "1"; + pwChangeDiv.style.display = "none"; + pwChangeDiv.style.zIndex = "-1"; + } else { + socialsDiv.style.display = "none"; + socialsDiv.style.zIndex = "-1"; + pwChangeDiv.style.display = "flex"; + pwChangeDiv.style.zIndex = "1"; + } + + +} diff --git a/styles/db_management.css b/styles/db_management.css index 075716b..b8a1aa5 100644 --- a/styles/db_management.css +++ b/styles/db_management.css @@ -35,6 +35,7 @@ border-radius: 5px; width: 400px; padding: 5px; + font-family: Arial, Helvetica, sans-serif; } .userMessage { diff --git a/styles/user_management.css b/styles/user_management.css index 5873605..a06e539 100644 --- a/styles/user_management.css +++ b/styles/user_management.css @@ -23,21 +23,6 @@ margin-bottom: 20px; } - -#accountDetailsPanel { - display: flex; - flex-direction: row; - flex-wrap: wrap; - width: 45%; - border: 1px solid black; - border-radius: 8px; - font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; - margin-right: 2%; - padding: 5px; - padding-bottom: 25px; - margin: 0 auto; -} - #accountSocialsPanel { display: flex; flex-direction: row; @@ -55,6 +40,49 @@ #accountSocialsPanel p { height: 25px; } +#accountSocialsPanel h3 { + text-align: center; +} + + + +#passwordChangePanel { + z-index: -1; + display: none; + flex-direction: row; + flex-wrap: wrap; + width: 45%; + border: 1px solid black; + border-radius: 8px; + font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; + margin-right: 2%; + padding: 5px; + padding-bottom: 25px; + margin: 0 auto; +} + +#passwordChangePanel p { + height: 25px; +} +#passwordChangePanel h3 { + text-align: center; +} + + +#accountDetailsPanel { + display: flex; + flex-direction: row; + flex-wrap: wrap; + width: 45%; + border: 1px solid black; + border-radius: 8px; + font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; + margin-right: 2%; + padding: 5px; + padding-bottom: 25px; + margin: 0 auto; +} + #accountDetailsPanel p { height: 25px; } @@ -62,9 +90,6 @@ #accountDetailsPanel h3 { text-align: center; } -#accountSocialsPanel h3 { - text-align: center; -} .accountDetailsLeftSide { width: 40%; @@ -92,6 +117,13 @@ text-align: right; } +#passwordChangePanel input[type="password"] { + text-align: right; + width: 100%; +} + + + #accountDetailsTitlePanel { text-align: center; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; @@ -270,4 +302,8 @@ .noUser { text-align: center; +} + +#passwordChangeBody { + display: flex; } \ No newline at end of file diff --git a/user/account.php b/user/account.php index cf8e327..b8c2c83 100644 --- a/user/account.php +++ b/user/account.php @@ -62,6 +62,7 @@ try { // Try opening the SQL database connection +Discord (name):
Discord (UserID):
- -
(coming soon!)
+ +