diff --git a/website/public/login.php b/website/public/login.php index 65babdf..b3da203 100644 --- a/website/public/login.php +++ b/website/public/login.php @@ -7,6 +7,17 @@ include_once("../queries/checkInput.php") ?> + + - - - diff --git a/website/public/settings.php b/website/public/settings.php index 45e50d8..d52608b 100644 --- a/website/public/settings.php +++ b/website/public/settings.php @@ -22,12 +22,13 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") { $result = updateSettings(); break; case "password": - $result = updatePassword(); + $result = changePassword(); break; case "email": $result = changeEmail(); break; case "picture": + updateProfilePicture(); $result = $notImplemented; break; } diff --git a/website/public/styles/index.css b/website/public/styles/index.css index c551fd1..4b55904 100644 --- a/website/public/styles/index.css +++ b/website/public/styles/index.css @@ -1,7 +1,7 @@ a.button { - background-color: #405550; + background-color: #C8CABD; border-radius: 10px; - color: white; + color: black; cursor: pointer; height: 50%; margin: 8px 0; @@ -46,8 +46,8 @@ body { form { /*background-color: #a87a87;*/ border-radius: 12px; - height: 75%; - margin: 10px auto; + height: 80%; + margin: auto; width: 70%; overflow-y:auto; } @@ -66,14 +66,15 @@ h2 { font-size: 2.0em; } + input[type=text], input[type=password], input[type=email], input[type="date"] { box-sizing: border-box; border-color: #C8CABD; display: inline-block; - height: 50%; + height: 60%; padding: 8px 20px; margin: 4px 0; - width: 50%; + width: 70%; } /* input[type=text], input[type=password], input[type=email], input[type="date"] { @@ -101,6 +102,31 @@ label { display: block; } +.left-arrow { + display: inline-block; + position: relative; + background-color: #C8CABD; + height: 30px; + width: 90px; + padding: 3px 3px 3px 0px; + text-align: center; + border-radius: 0px 10px 10px 0px; + font-size: 24px; + +} +.left-arrow:after { + content: ''; + display: block; + position: absolute; + right: 100%; + top: 0; + bottom: 0; + border-top: 15px solid transparent; + border-right: 20px solid #C8CABD; + border-bottom: 15px solid transparent; + border-left: 0px solid transparent; +} + /* padding voor registreer container */ .login_containerregister { padding: 16px; @@ -109,7 +135,7 @@ label { /* padding voor login_containers */ .login_containerlogin { - padding: 16px; + padding:25px; text-align: center; } @@ -133,11 +159,11 @@ label { background-repeat: repeat-x; background-attachment: fixed;*/ box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24); - height: 53%; + height: 550px; margin: 34px auto; overflow-y: auto; padding: 20px; - width: 35%; + width: 50%; } /*.platform { diff --git a/website/queries/settings.php b/website/queries/settings.php index 7c92583..7d3bf9c 100644 --- a/website/queries/settings.php +++ b/website/queries/settings.php @@ -87,11 +87,11 @@ function updateSettings() { `userID` = :userID "); - $stmt->bindParam(":fname", $_POST["fname"]); - $stmt->bindParam(":lname", $_POST["lname"]); - $stmt->bindParam(":location", $_POST["location"]); + $stmt->bindParam(":fname", test_input($_POST["fname"])); + $stmt->bindParam(":lname", test_input($_POST["lname"])); + $stmt->bindParam(":location", test_input($_POST["location"])); $stmt->bindParam(":bday", $_POST["bday"]); - $stmt->bindParam(":bio", $_POST["bio"]); + $stmt->bindParam(":bio", test_input($_POST["bio"])); $stmt->bindParam(":userID", $_SESSION["userID"]); $stmt->execute(); @@ -99,11 +99,11 @@ function updateSettings() { return new settingsMessage("happy", "Instellingen zijn opgeslagen."); } -function updatePassword() { +function changePassword() { $user = getPasswordHash(); if (password_verify($_POST["password-old"], $user["password"])) { if ($_POST["password-new"] == $_POST["password-confirm"] && (strlen($_POST["password-new"]) >= 8)) { - if (changePassword()) { + if (doChangePassword()) { return new settingsMessage("happy", "Wachtwoord gewijzigd."); } else { return new settingsMessage("angry", "Er is iets mis gegaan."); @@ -116,7 +116,7 @@ function updatePassword() { } } -function changePassword() { +function doChangePassword() { $stmt = $GLOBALS["db"]->prepare(" UPDATE `user` @@ -184,4 +184,26 @@ function doChangeEmail($email) { $stmt->bindParam(":userID", $_SESSION["userID"]); $stmt->execute(); return $stmt->rowCount(); +} + +function updateProfilePicture() { + $profilePictureDir = "/var/www/html/public/"; + $relativePath = "uploads/" . $_SESSION["userID"] . "_" . basename($_FILES["pp"]["name"]); + move_uploaded_file($_FILES['pp']['tmp_name'], $profilePictureDir . $relativePath); + setProfilePictureToDatabase("../" . $relativePath); +} + +function setProfilePictureToDatabase($url) { + $stmt = $GLOBALS["db"]->prepare(" + UPDATE + `user` + SET + `profilepicture` = :profilepicture + WHERE + `userID` = :userID + "); + + $stmt->bindParam(":profilepicture", $url); + $stmt->bindParam(":userID", $_SESSION["userID"]); + $stmt->execute(); } \ No newline at end of file diff --git a/website/views/adminpanel.php b/website/views/adminpanel.php index e8efe6f..e53d679 100644 --- a/website/views/adminpanel.php +++ b/website/views/adminpanel.php @@ -62,12 +62,6 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") { $listn = ($currentpage-1) * $perpage; $listm = $currentpage * $perpage; -function test_input($data) { - $data = trim($data); - $data = stripslashes($data); - $data = htmlspecialchars($data); - return $data; -} ?>
diff --git a/website/views/register-view.php b/website/views/register-view.php index 4ccf868..7d1843b 100644 --- a/website/views/register-view.php +++ b/website/views/register-view.php @@ -123,13 +123,12 @@ value="Registreer uw account" name="Submit" id="frm1_submit"> - Registreer uw account + Registreer
- -
- Login met een account + + Login
diff --git a/website/views/settings-view.php b/website/views/settings-view.php index 6d9d660..1fa5278 100644 --- a/website/views/settings-view.php +++ b/website/views/settings-view.php @@ -68,7 +68,7 @@ $settings = getSettings(); -
+
Verander profielfoto