Kevin prototype #93
@@ -7,6 +7,17 @@
|
|||||||
include_once("../queries/checkInput.php")
|
include_once("../queries/checkInput.php")
|
||||||
?>
|
?>
|
||||||
<body>
|
<body>
|
||||||
|
<script>
|
||||||
|
function checkLoggedIn() {
|
||||||
|
if (confirm("You are already logged in!\nDo you want to logout?\nPress ok to logout.") == true) {
|
||||||
|
window.location.href = "logout.php";
|
||||||
|
} else {
|
||||||
|
window.history.back();
|
||||||
|
}
|
||||||
|
document.getElementById("demo").innerHTML = x;
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
session_start();
|
session_start();
|
||||||
|
|
||||||
@@ -48,18 +59,5 @@
|
|||||||
/* This view adds login view */
|
/* This view adds login view */
|
||||||
include("../views/login-view.php");
|
include("../views/login-view.php");
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<script>
|
|
||||||
function checkLoggedIn() {
|
|
||||||
if (confirm("You are already logged in!\Do you want to logout?\Press ok to logout.") == true) {
|
|
||||||
unset($_SESSION["userID"]);
|
|
||||||
header("Location: login.php");
|
|
||||||
} else {
|
|
||||||
header("location: profile.php");
|
|
||||||
}
|
|
||||||
document.getElementById("demo").innerHTML = x;
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -22,12 +22,13 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
|
|||||||
$result = updateSettings();
|
$result = updateSettings();
|
||||||
break;
|
break;
|
||||||
case "password":
|
case "password":
|
||||||
$result = updatePassword();
|
$result = changePassword();
|
||||||
break;
|
break;
|
||||||
case "email":
|
case "email":
|
||||||
$result = changeEmail();
|
$result = changeEmail();
|
||||||
break;
|
break;
|
||||||
case "picture":
|
case "picture":
|
||||||
|
updateProfilePicture();
|
||||||
$result = $notImplemented;
|
$result = $notImplemented;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
a.button {
|
a.button {
|
||||||
background-color: #405550;
|
background-color: #C8CABD;
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
color: white;
|
color: black;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
height: 50%;
|
height: 50%;
|
||||||
margin: 8px 0;
|
margin: 8px 0;
|
||||||
@@ -46,8 +46,8 @@ body {
|
|||||||
form {
|
form {
|
||||||
/*background-color: #a87a87;*/
|
/*background-color: #a87a87;*/
|
||||||
border-radius: 12px;
|
border-radius: 12px;
|
||||||
height: 75%;
|
height: 80%;
|
||||||
margin: 10px auto;
|
margin: auto;
|
||||||
width: 70%;
|
width: 70%;
|
||||||
overflow-y:auto;
|
overflow-y:auto;
|
||||||
}
|
}
|
||||||
@@ -66,14 +66,15 @@ h2 {
|
|||||||
font-size: 2.0em;
|
font-size: 2.0em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
input[type=text], input[type=password], input[type=email], input[type="date"] {
|
input[type=text], input[type=password], input[type=email], input[type="date"] {
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
border-color: #C8CABD;
|
border-color: #C8CABD;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
height: 50%;
|
height: 60%;
|
||||||
padding: 8px 20px;
|
padding: 8px 20px;
|
||||||
margin: 4px 0;
|
margin: 4px 0;
|
||||||
width: 50%;
|
width: 70%;
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
input[type=text], input[type=password], input[type=email], input[type="date"] {
|
input[type=text], input[type=password], input[type=email], input[type="date"] {
|
||||||
@@ -101,6 +102,31 @@ label {
|
|||||||
display: block;
|
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 */
|
/* padding voor registreer container */
|
||||||
.login_containerregister {
|
.login_containerregister {
|
||||||
padding: 16px;
|
padding: 16px;
|
||||||
@@ -109,7 +135,7 @@ label {
|
|||||||
|
|
||||||
/* padding voor login_containers */
|
/* padding voor login_containers */
|
||||||
.login_containerlogin {
|
.login_containerlogin {
|
||||||
padding: 16px;
|
padding:25px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -133,11 +159,11 @@ label {
|
|||||||
background-repeat: repeat-x;
|
background-repeat: repeat-x;
|
||||||
background-attachment: fixed;*/
|
background-attachment: fixed;*/
|
||||||
box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
|
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;
|
margin: 34px auto;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
padding: 20px;
|
padding: 20px;
|
||||||
width: 35%;
|
width: 50%;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*.platform {
|
/*.platform {
|
||||||
|
|||||||
@@ -87,11 +87,11 @@ function updateSettings() {
|
|||||||
`userID` = :userID
|
`userID` = :userID
|
||||||
");
|
");
|
||||||
|
|
||||||
$stmt->bindParam(":fname", $_POST["fname"]);
|
$stmt->bindParam(":fname", test_input($_POST["fname"]));
|
||||||
$stmt->bindParam(":lname", $_POST["lname"]);
|
$stmt->bindParam(":lname", test_input($_POST["lname"]));
|
||||||
$stmt->bindParam(":location", $_POST["location"]);
|
$stmt->bindParam(":location", test_input($_POST["location"]));
|
||||||
$stmt->bindParam(":bday", $_POST["bday"]);
|
$stmt->bindParam(":bday", $_POST["bday"]);
|
||||||
$stmt->bindParam(":bio", $_POST["bio"]);
|
$stmt->bindParam(":bio", test_input($_POST["bio"]));
|
||||||
$stmt->bindParam(":userID", $_SESSION["userID"]);
|
$stmt->bindParam(":userID", $_SESSION["userID"]);
|
||||||
|
|
||||||
$stmt->execute();
|
$stmt->execute();
|
||||||
@@ -99,11 +99,11 @@ function updateSettings() {
|
|||||||
return new settingsMessage("happy", "Instellingen zijn opgeslagen.");
|
return new settingsMessage("happy", "Instellingen zijn opgeslagen.");
|
||||||
}
|
}
|
||||||
|
|
||||||
function updatePassword() {
|
function changePassword() {
|
||||||
$user = getPasswordHash();
|
$user = getPasswordHash();
|
||||||
if (password_verify($_POST["password-old"], $user["password"])) {
|
if (password_verify($_POST["password-old"], $user["password"])) {
|
||||||
if ($_POST["password-new"] == $_POST["password-confirm"] && (strlen($_POST["password-new"]) >= 8)) {
|
if ($_POST["password-new"] == $_POST["password-confirm"] && (strlen($_POST["password-new"]) >= 8)) {
|
||||||
if (changePassword()) {
|
if (doChangePassword()) {
|
||||||
return new settingsMessage("happy", "Wachtwoord gewijzigd.");
|
return new settingsMessage("happy", "Wachtwoord gewijzigd.");
|
||||||
} else {
|
} else {
|
||||||
return new settingsMessage("angry", "Er is iets mis gegaan.");
|
return new settingsMessage("angry", "Er is iets mis gegaan.");
|
||||||
@@ -116,7 +116,7 @@ function updatePassword() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function changePassword() {
|
function doChangePassword() {
|
||||||
$stmt = $GLOBALS["db"]->prepare("
|
$stmt = $GLOBALS["db"]->prepare("
|
||||||
UPDATE
|
UPDATE
|
||||||
`user`
|
`user`
|
||||||
@@ -185,3 +185,25 @@ function doChangeEmail($email) {
|
|||||||
$stmt->execute();
|
$stmt->execute();
|
||||||
return $stmt->rowCount();
|
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();
|
||||||
|
}
|
||||||
@@ -62,12 +62,6 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
|
|||||||
$listn = ($currentpage-1) * $perpage;
|
$listn = ($currentpage-1) * $perpage;
|
||||||
$listm = $currentpage * $perpage;
|
$listm = $currentpage * $perpage;
|
||||||
|
|
||||||
function test_input($data) {
|
|
||||||
$data = trim($data);
|
|
||||||
$data = stripslashes($data);
|
|
||||||
$data = htmlspecialchars($data);
|
|
||||||
return $data;
|
|
||||||
}
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<div class="content">
|
<div class="content">
|
||||||
|
|||||||
@@ -123,13 +123,12 @@
|
|||||||
value="Registreer uw account"
|
value="Registreer uw account"
|
||||||
name="Submit"
|
name="Submit"
|
||||||
id="frm1_submit">
|
id="frm1_submit">
|
||||||
Registreer uw account
|
Registreer
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<!-- Button for going back to login screen -->
|
|
||||||
<div class="login_containerlogin">
|
<div class="login_containerlogin">
|
||||||
<a href="https://myhyvesbookplus.nl/login.php" class="button">Login met een account</a>
|
<!-- Button for going back to login screen -->
|
||||||
|
<a href="https://myhyvesbookplus.nl/login.php" class="left-arrow">Login</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ $settings = getSettings();
|
|||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</form>
|
</form>
|
||||||
<form class="settings-profilepictue platform" method="post">
|
<form class="settings-profilepictue platform" method="post" enctype="multipart/form-data">
|
||||||
<h5>Verander profielfoto</h5>
|
<h5>Verander profielfoto</h5>
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
|
|||||||
Reference in New Issue
Block a user