Fixed bugs

This commit is contained in:
Joey Lai
2017-01-27 14:03:11 +01:00
parent 609f350cd3
commit 5e9629eddd
10 changed files with 127 additions and 113 deletions

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();