Fixed bugs
This commit is contained in:
@@ -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");
|
||||
}
|
||||
|
||||
@@ -1,90 +1,91 @@
|
||||
<?php
|
||||
try {
|
||||
|
||||
try {
|
||||
$name = test_input(($_POST["name"]));
|
||||
checkInputChoice($name, "lettersAndSpaces");
|
||||
} catch(lettersAndSpacesException $e){
|
||||
} catch(lettersAndSpacesException $e){
|
||||
$correct = false;
|
||||
$nameErr = $e->getMessage();
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
try {
|
||||
$surname = test_input(($_POST["surname"]));
|
||||
checkInputChoice($surname, "lettersAndSpaces");
|
||||
}
|
||||
catch(lettersAndSpacesException $e){
|
||||
}
|
||||
catch(lettersAndSpacesException $e){
|
||||
$correct = false;
|
||||
$surnameErr = $e->getMessage();
|
||||
}
|
||||
}
|
||||
|
||||
try{
|
||||
try{
|
||||
$day_date = test_input(($_POST["day_date"]));
|
||||
$month_date = test_input(($_POST["month_date"]));
|
||||
$year_date = test_input(($_POST["year_date"]));
|
||||
$bday = $year_date . "-" . $month_date . "-" . $day_date;
|
||||
checkInputChoice($bday, "bday");
|
||||
} catch(bdayException $e){
|
||||
} catch(bdayException $e){
|
||||
$correct = false;
|
||||
$bdayErr = $e->getMessage();
|
||||
}
|
||||
}
|
||||
|
||||
try{
|
||||
try{
|
||||
$username = str_replace(' ', '', test_input(($_POST["username"])));
|
||||
checkInputChoice($username, "username");
|
||||
} catch(usernameException $e){
|
||||
} catch(usernameException $e){
|
||||
$correct = false;
|
||||
$usernameErr = $e->getMessage();
|
||||
}
|
||||
}
|
||||
|
||||
try{
|
||||
try{
|
||||
$password = str_replace(' ', '', test_input(($_POST["password"])));
|
||||
checkInputChoice($password, "longerEight");
|
||||
matchPassword();
|
||||
} catch(passwordException $e){
|
||||
} catch(passwordException $e){
|
||||
$correct = false;
|
||||
$passwordErr = $e->getMessage();
|
||||
} catch(confirmPasswordException $e){
|
||||
} catch(confirmPasswordException $e){
|
||||
$correct = false;
|
||||
$confirmPasswordErr = $e->getMessage();
|
||||
}
|
||||
}
|
||||
|
||||
try{
|
||||
try{
|
||||
$location = test_input(($_POST["location"]));
|
||||
checkInputChoice($location, "lettersAndSpaces");
|
||||
} catch(lettersAndSpacesException $e){
|
||||
} catch(lettersAndSpacesException $e){
|
||||
$correct = false;
|
||||
$locationErr = $e->getMessage();
|
||||
}
|
||||
}
|
||||
|
||||
try{
|
||||
try{
|
||||
$email = test_input(($_POST["email"]));
|
||||
checkInputChoice($email, "email");
|
||||
$confirmEmail = test_input(($_POST["confirmEmail"]));
|
||||
matchEmail();
|
||||
} catch(emailException $e){
|
||||
} catch(emailException $e){
|
||||
$correct = false;
|
||||
$emailErr = $e->getMessage();
|
||||
} catch(confirmEmailException $e){
|
||||
} catch(confirmEmailException $e){
|
||||
$correct = false;
|
||||
$confirmEmailErr = $e->getMessage();
|
||||
}
|
||||
}
|
||||
|
||||
try{
|
||||
try{
|
||||
$captcha = $_POST['g-recaptcha-response'];
|
||||
checkCaptcha($captcha);
|
||||
} catch(captchaException $e){
|
||||
} catch(captchaException $e){
|
||||
$correct = false;
|
||||
$captchaErr = $e->getMessage();
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
try {
|
||||
getIp();
|
||||
registerCheck($correct);
|
||||
sendConfirmEmailUsername($username);
|
||||
} catch(registerException $e){
|
||||
} catch(registerException $e){
|
||||
echo "<script>
|
||||
window.onload = function() {
|
||||
$('#registerModal').show();
|
||||
}
|
||||
</script>";
|
||||
$genericErr = $e->getMessage();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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">
|
||||
|
||||
@@ -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 () {
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user