Made different files for login and register #142

Merged
11057122 merged 1 commits from joey-testing into master 2017-01-27 14:04:40 +01:00
10 changed files with 127 additions and 113 deletions

View File

@@ -1,5 +1,5 @@
function checkLoggedIn() {
if (confirm("You are already logged in!\nDo you want to logout?\nPress ok to logout.") == true) {
if (confirm("U bent al ingelogd!!\nWilt u uitloggen?\nKlik ok om uit te loggen.") == true) {
window.location.href = "logout.php";
} else {
window.location.href = "profile.php";
@@ -7,9 +7,9 @@ function checkLoggedIn() {
}
function bannedAlert(){
alert("Your account is banned");
alert("Uw account is geband!");
}
function emailNotConfirmed(){
alert("Your account has not been verified yet!\nAnother email has been sent to you")
alert("Uw account is nog niet bevestigd!\nEr is een nieuwe email gestuurd om uw account te bevestigen");
}

View File

@@ -1,4 +1,5 @@
<?php
try {
$name = test_input(($_POST["name"]));
checkInputChoice($name, "lettersAndSpaces");

View File

@@ -68,6 +68,10 @@ input[type=text], input[type=password], input[type=email], input[type="date"] {
width: 55%;
}
.middle{
text-align: center;
}
.center{
text-align: center;
}

View File

@@ -124,11 +124,11 @@ function matchPassword(){
/* Checks if captcha is correctly filled in */
function checkCaptcha($captcha){
if(!$captcha){
throw new captchaException("Captcha needs to be filled in!");
throw new captchaException("Captcha moet ingevuld worde!");
} else {
$response=json_decode(file_get_contents("https://www.google.com/recaptcha/api/siteverify?secret=6Lc72xIUAAAAAPizuF3nUbklCPljVCVzgYespz8o&response=".$captcha."&remoteip=".$_SERVER['REMOTE_ADDR']));
if($response->success==false) {
throw new captchaException("You are a spammer!");
throw new captchaException("Je bent een spammer!");
}
}
}

View File

@@ -42,9 +42,9 @@ function validateLogin($username, $password){
</script>";
} else {
$_SESSION["userID"] = $userID;
if($_POST[rememberMe] == 1){
ini_set("session.gc_maxlifetime", "10");
}
// if($_POST[rememberMe] == 1){
// ini_set("session.gc_maxlifetime", "10");
// }
header("location: profile.php");
}
} else {

View File

@@ -10,7 +10,7 @@ function getExistingUsername() {
`username` LIKE :username
");
$stmt->bindParam(":username", test_input($_POST["username"]));
$stmt->bindValue(":username", test_input($_POST["username"]));
$stmt->execute();
return $stmt->rowCount();
@@ -26,7 +26,7 @@ function getExistingEmail() {
`email` LIKE :email
");
$stmt->bindParam(":email", test_input($_POST["email"]));
$stmt->bindValue(":email", test_input($_POST["email"]));
$stmt->execute();
return $stmt->rowCount();
@@ -42,7 +42,7 @@ function getResetEmail() {
`email` LIKE :email
");
$stmt->bindParam(":email", test_input($_POST["forgotEmail"]));
$stmt->bindValue(":email", test_input($_POST["forgotEmail"]));
$stmt->execute();
return $stmt->rowCount();
@@ -70,13 +70,13 @@ function registerAccount() {
$hash=password_hash($_POST["password"], PASSWORD_DEFAULT);
$stmt->bindParam(":fname", test_input($_POST["name"]));
$stmt->bindParam(":lname", test_input($_POST["surname"]));
$stmt->bindParam(":bday", test_input($_POST["bday"]));
$stmt->bindParam(":username", test_input($_POST["username"]));
$stmt->bindParam(":password", test_input($hash));
$stmt->bindParam(":location", test_input($_POST["location"]));
$stmt->bindParam(":email", test_input(strtolower($_POST["email"])));
$stmt->bindValue(":fname", test_input($_POST["name"]));
$stmt->bindValue(":lname", test_input($_POST["surname"]));
$stmt->bindValue(":bday", test_input($_POST["bday"]));
$stmt->bindValue(":username", test_input($_POST["username"]));
$stmt->bindValue(":password", test_input($hash));
$stmt->bindValue(":location", test_input($_POST["location"]));
$stmt->bindValue(":email", test_input(strtolower($_POST["email"])));
$stmt->execute();
$stmt->rowCount();

View File

@@ -11,18 +11,18 @@
</select>
<select name="month_date">
<option>Maand</option>
<option value="01" <?php submitselect($month_date, "01")?>>Januari</option>
<option value="02" <?php submitselect($month_date, "02")?>>Februari</option>
<option value="03" <?php submitselect($month_date, "03")?>>Maart</option>
<option value="04" <?php submitselect($month_date, "04")?>>April</option>
<option value="05" <?php submitselect($month_date, "05")?>>Mei</option>
<option value="06" <?php submitselect($month_date, "06")?>>Juni</option>
<option value="07" <?php submitselect($month_date, "07")?>>Juli</option>
<option value="08" <?php submitselect($month_date, "08")?>>Augustus</option>
<option value="09" <?php submitselect($month_date, "09")?>>September</option>
<option value="10" <?php submitselect($month_date, "10")?>>Oktober</option>
<option value="11" <?php submitselect($month_date, "11")?>>November</option>
<option value="12" <?php submitselect($month_date, "12")?>>December</option>
<option value="01" <?php submitselect($month_date, "01")?>>januari</option>
<option value="02" <?php submitselect($month_date, "02")?>>februari</option>
<option value="03" <?php submitselect($month_date, "03")?>>maart</option>
<option value="04" <?php submitselect($month_date, "04")?>>april</option>
<option value="05" <?php submitselect($month_date, "05")?>>mei</option>
<option value="06" <?php submitselect($month_date, "06")?>>juni</option>
<option value="07" <?php submitselect($month_date, "07")?>>juli</option>
<option value="08" <?php submitselect($month_date, "08")?>>augustus</option>
<option value="09" <?php submitselect($month_date, "09")?>>september</option>
<option value="10" <?php submitselect($month_date, "10")?>>oktober</option>
<option value="11" <?php submitselect($month_date, "11")?>>november</option>
<option value="12" <?php submitselect($month_date, "12")?>>december</option>
</select>
<select name="year_date">
<option>Jaar</option>

View File

@@ -16,6 +16,7 @@
</div>
<div class="modal-body">
<input type="text"
class="middle"
placeholder="Voer uw email in"
name="forgotEmail"
title="Voer een email in">

View File

@@ -15,6 +15,7 @@
<div class="login_containerlogin">
<label><b>Gebruikersnaam/Email</b></label>
<input type="text"
class="middle"
placeholder="Voer uw gebruikersnaam/email in"
name="user"
value="<?php echo $user ?>"
@@ -26,17 +27,13 @@
<div class="login_containerlogin">
<label><b>Wachtwoord</b></label>
<input type="password"
class="middle"
placeholder="Voer uw wachtwoord in"
name="psw"
title="Moet minstens 8 karakters lang zijn"
>
</div>
<div class="login_containerlogin">
<label><b>Onthoud mij</b></label>
<input type="checkbox" name="rememberMe" value=1><br>
</div>
<!-- Error message -->
<div class="login_containerfault"><span><?php echo $loginErr; ?></span></div>
@@ -49,6 +46,11 @@
Inloggen
</button>
</div>
<div class="login_containerlogin">
<label><b>Onthoud mij</b></label>
<input type="checkbox" name="rememberMe" value=1><br>
</div>
</form>
</div>
@@ -78,7 +80,10 @@ var registerSpan = document.getElementsByClassName("close")[1];
// When the user clicks the button, open the modal
btn.onclick = function () {
// modal.style.display = "block";
modal.style.display = "block";
window.onload=emailSent();
}
registerBtn.onclick = function () {

View File

@@ -19,6 +19,8 @@
return= $correct
method="post">
<div class="login_containerregister"><label>U krijgt een bevestigingsemail na het registreren</label></div>
<!-- Error message -->
<div class="login_containerfault"><?php echo $genericErr;?></span></div>
@@ -135,7 +137,8 @@
</div>
<div class="login_containerregister">
<div class="g-recaptcha" data-sitekey="6Lc72xIUAAAAADumlWetgENm7NGd9Npyo0c_tYYQ"></div>
<div class="g-recaptcha" data-sitekey="6Lc72xIUAAAAADumlWetgENm7NGd9Npyo0c_tYYQ">
</div>
<span class="error"> <?php echo $captchaErr;?></span>
</div>