Merge branch 'master' into 'marijn-settings'

# Conflicts:
#   website/queries/settings.php
This commit is contained in:
Marijn Jansen
2017-01-18 14:52:32 +01:00
16 changed files with 697 additions and 387 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

View File

@@ -1,5 +1,6 @@
$(document).ready(function() {
$(".extra-menu-items").hide();
$("#menu-back").hide();
// Show more friends
$("#more-friends-click").click(function() {

View File

@@ -1,13 +1,44 @@
<!DOCTYPE html>
<html>
<?php
include("../views/login_head.php");
include("../views/login_head.php");
include_once("../queries/connect.php");
include_once("../queries/login.php");
?>
<body>
<?php
/*
* This view adds login view
*/
session_start();
// Define variables and set to empty values
$uname = $psw ="";
$loginErr ="";
// Trying to login
if ($_SERVER["REQUEST_METHOD"] == "POST") {
// Empty username or password field
if (empty($_POST["uname"]) || empty($_POST["psw"])) {
$loginErr = "Gebruikersnaam of wachtwoord is niet ingevuld";
}
else {
$uname=strtolower($_POST["uname"]);
$psw=$_POST["psw"];
$hash=hashPassword()["password"];
$userid=hashPassword()["userID"];
// If there's an account, go to the profile page
if(password_verify($psw.$uname, $hash)) {
$_SESSION["userID"] = $userid;
header("location: /profile.php");
} else {
$loginErr = "Inloggegevens zijn niet correct";
}
}
}
/* This view adds login view */
include("../views/login-view.php");
?>
</body>

165
website/public/register.php Normal file
View File

@@ -0,0 +1,165 @@
<!DOCTYPE html>
<html>
<?php
include("../views/login_head.php");
include_once("../queries/connect.php");
include_once("../queries/register.php");
?>
<body>
<?php
session_start();
// define variables and set to empty values
$name = $surname = $bday = $username = $password = $confirmpassword = $location = $housenumber = $email = "";
$genericErr = $nameErr = $surnameErr = $bdayErr = $usernameErr = $passwordErr = $confirmpasswordErr = $locationErr = $housenumberErr = $emailErr = "";
$correct = true;
// Saves information of filling in the form
if (isset($_POST["name"])) {
$name = $_POST["name"];
}
if (isset($_POST["surname"])) {
$surname = $_POST["surname"];
}
if (isset($_POST["bday"])) {
$bday = $_POST["bday"];
}
if (isset($_POST["username"])) {
$username = $_POST["username"];
}
if (isset($_POST["password"])) {
$password = $_POST["password"];
}
if (isset($_POST["location"])) {
$location = $_POST["location"];
}
if (isset($_POST["housenumber"])) {
$housenumber = $_POST["housenumber"];
}
if (isset($_POST["email"])) {
$email = $_POST["email"];
}
// Trying to register an account
if ($_SERVER["REQUEST_METHOD"] == "POST") {
if (empty($_POST["name"])) {
$nameErr = "Naam is verplicht!";
$correct = false;
} else {
if (!preg_match("/^[a-zA-Z ]*$/",$name)) {
$nameErr = "Alleen letters en spaties zijn toegestaan!";
$correct = false;
}
}
if (empty($_POST["surname"])) {
$surnameErr = "Achternaam is verplicht!";
$correct = false;
} else {
if (!preg_match("/^[a-zA-Z ]*$/",$surname)) {
$surnameErr = "Alleen letters en spaties zijn toegestaan!";
$correct = false;
}
}
if (empty($_POST["bday"])) {
$bdayErr = "Geboortedatum is verplicht!";
$correct = false;
}
if (empty($_POST["username"])) {
$usernameErr = "Gebruikersnaam is verplicht!";
$correct = false;
} else {
if (strlen($username) < 6) {
$usernameErr = "Gebruikersnaam moet minstens 6 karakters bevatten";
$correct = false;
} else if (getExistingUsername() == 1){
$usernameErr = "Gebruikersnaam bestaat al";
$correct = false;
}
}
if (empty($_POST["password"])) {
$passwordErr = "Wachtwoord is verplicht!";
$correct = false;
} else {
if (strlen($password) < 8) {
$passwordErr = "Wachtwoord moet minstens 8 karakters bevatten";
$correct = false;
}
}
if (empty($_POST["confirmpassword"])) {
$confirmpasswordErr = "Herhaal wachtwoord!";
$correct = false;
}
if ($_POST["password"] != $_POST["confirmpassword"]) {
$confirmpasswordErr = "Wachtwoorden matchen niet";
$correct = false;
}
if (empty($_POST["location"])) {
$locationErr = "Straatnaam is verplicht!";
$correct = false;
} else {
if (!preg_match("/^[a-zA-Z ]*$/",$location)) {
$locationErr = "Alleen letters en spaties zijn toegestaan!";
$correct = false;
}
}
if (empty($_POST["email"])) {
$emailErr = "Email is verplicht!";
$correct = false;
} else {
if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
$emailErr = "Geldige email invullen!";
$correct = false;
} else if (getExistingEmail() == 1){
$emailErr = "Email bestaat al";
$correct = false;
}
}
// Checks if everything is filled in correctly
if ($correct == false){
$genericErr = "Bepaalde velden zijn verkeerd of niet ingevuld!";
} else {
registerAccount();
header("location: login.php");
}
}
/* This view adds register view */
include("../views/register-view.php");
?>
</body>
</html>

View File

@@ -1,98 +1,118 @@
::selection {
background: #845663;
color: white;
background: #845663;
color: white;
}
::-moz-selection {
background: #845663;
color: white;
background: #845663;
color: white;
}
a, a:link, a:visited, a:hover, a:active {
color: inherit;
text-decoration: none;
color: inherit;
text-decoration: none;
}
a.button {
background-color: #845663;
border: 2px solid black;
border-radius: 12px;
color: white;
cursor: pointer;
height: 50%;
margin: 8px 0;
padding: 14px 20px;
width: 25%;
font-family: Arial;
font-size: 16px;
}
a[data-title]:hover:after, img[data-title]:hover:after, span[data-title]:hover:after,
div[data-title]:hover:after{
content: attr(data-title);
padding: 4px 4px;
color: #FFFFFF;
position: absolute;
left: 0;
top: 100%;
z-index: 20;
white-space: nowrap;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
-moz-box-shadow: 0px 0px 4px #222;
-webkit-box-shadow: 0px 0px 4px #222;
box-shadow: 0px 0px 4px #222;
background-color: #333;
font-size: 15px;
line-height: normal;
font-family: Arial, sans-serif;
content: attr(data-title);
padding: 4px 4px;
color: #FFFFFF;
position: absolute;
left: 0;
top: 100%;
z-index: 20;
white-space: nowrap;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
-moz-box-shadow: 0px 0px 4px #222;
-webkit-box-shadow: 0px 0px 4px #222;
box-shadow: 0px 0px 4px #222;
background-color: #333;
font-size: 15px;
line-height: normal;
font-family: Arial, sans-serif;
}
/* Add Zoom Animation */
.animate {
animation: animatezoom 0.6s
-webkit-animation: animatezoom 0.6s;
animation: animatezoom 0.6s
-webkit-animation: animatezoom 0.6s;
}
/* Body */
body {
height: 100%;
height: 900px;
background-color: #B78996;
color: #333;
background-image: url(https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTEnqKdVtLbxjKuNsCSCxFRhTOpp3Gm0gsU8bMgA_MeUYyzrUFy);
background-size: contain;
background-repeat: repeat-x;
background-attachment: fixed;
font-family: Arial, sans-serif;
/*background-color: #B78996;*/
color: #333;
font-family: Arial, sans-serif;
}
/* stijl voor alle buttons */
button {
background-color: #845663;
border: 2px solid black;
border-radius: 12px;
color: white;
cursor: pointer;
height: 50%;
margin: 8px 0;
padding: 14px 20px;
width: 25%;
font-family: Arial;
font-size: 16px;
background-color: #845663;
border: 2px solid black;
border-radius: 12px;
color: white;
cursor: pointer;
height: 50%;
margin: 8px 0;
padding: 14px 20px;
width: 25%;
font-family: Arial;
font-size: 16px;
}
/* The Close Button */
.close {
/* Position it in the top right corner outside of the modal */
color: white;
font-size: 100px;
font-weight: bold;
position: absolute;
right: 25px;
top: 0;
color: white;
font-size: 100px;
font-weight: bold;
position: absolute;
right: 25px;
top: 0;
}
/* Close button on hover */
.close:hover,
.close:focus {
color: red;
cursor: pointer;
color: red;
cursor: pointer;
}
/* inlogform */
form {
background-color: #a87a87;
/*background-color: #a87a87;*/
border: 5px solid #325da3;
background-color: #a87a87;
border-radius: 12px;
height: 50%;
margin: auto;
width: 55%;
height: 57%;
margin: 8px auto;
width: 45%;
overflow: auto;
}
/* inlog titel */
@@ -142,14 +162,21 @@ label {
/* padding voor registreer container */
.login_containerregister {
padding: 16px;
text-align: left;
padding: 16px;
text-align: left;
}
/* padding voor login_containers */
.login_containerlogin {
padding: 16px;
text-align: center;
padding: 16px;
text-align: center;
}
/* padding voor foutmelding login */
.login_containerfault {
padding: 16px;
text-align: center;
color: red;
}
/* The Modal (background) */
@@ -175,12 +202,13 @@ label {
margin: 5px auto; /* 15% from the top and centered */
overflow-y: auto;
width: 40%; /* Could be more or less, depending on screen size */
height: 80%;
height: 60%;
}
@keyframes animatezoom {
from {transform: scale(0)}
to {transform: scale(1)}
from {transform: scale(0)}
to {transform: scale(1)}
}
/* datepicker */
@@ -203,6 +231,6 @@ select {
}
ul {
font-family: Arial;
font-size: 16px;
font-family: Arial;
font-size: 16px;
}

View File

@@ -4,7 +4,6 @@
<body>
<?php
// database gegevens zijn elders opgeslagen
include_once("../queries/connect.php");
include_once("../queries/friendship.php");