diff --git a/website/public/js/registerAndLogin.js b/website/public/js/registerAndLogin.js index 4e68a07..ef49e83 100644 --- a/website/public/js/registerAndLogin.js +++ b/website/public/js/registerAndLogin.js @@ -8,4 +8,8 @@ function checkLoggedIn() { function bannedAlert(){ alert("Your account is banned"); +} + +function emailNotConfirmed(){ + alert("Your account has not been verified yet!\nAnother email has been sent to you") } \ No newline at end of file diff --git a/website/public/login.php b/website/public/login.php index b3a00b0..de4ecab 100644 --- a/website/public/login.php +++ b/website/public/login.php @@ -5,6 +5,7 @@ require_once("../queries/connect.php"); include_once("../queries/login.php"); include_once("../queries/checkInput.php"); + include_once("../queries/emailconfirm.php"); ?>
getMessage(); diff --git a/website/public/logout.php b/website/public/logout.php index 6a2ba5d..de4d7c2 100644 --- a/website/public/logout.php +++ b/website/public/logout.php @@ -1,15 +1,4 @@ - - - - - - +session_start(); +session_destroy(); +header("Location: login.php"); \ No newline at end of file diff --git a/website/public/register.php b/website/public/register.php index 84d6873..1ce4817 100644 --- a/website/public/register.php +++ b/website/public/register.php @@ -5,6 +5,7 @@ require_once("../queries/connect.php"); include_once("../queries/register.php"); include_once("../queries/checkInput.php"); + include_once("../queries/emailconfirm.php"); ?> getMessage(); } diff --git a/website/queries/emailconfirm.php b/website/queries/emailconfirm.php index 583a47b..0b3224f 100644 --- a/website/queries/emailconfirm.php +++ b/website/queries/emailconfirm.php @@ -25,7 +25,9 @@ function sendConfirmEmail(int $userID) { WHERE `userID` = :userID "); + $stmt->bindParam(":userID", $userID); + $stmt->execute(); $user = $stmt->fetch(); $email = $user["email"]; @@ -34,10 +36,7 @@ function sendConfirmEmail(int $userID) { $confirmLink = "https://myhyvesbookplus.nl/emailconfirm.php?u=$userID&h=$hash"; $subject = "Bevestig uw emailadres"; - $body = "Hallo $fname,\r\n\r\n - Klik op de onderstaande link om uw emailadres te bevestigen.\r\n\r\n - $confirmLink\r\n\r\n - Groeten MyHyvesbook+"; + $body = "Hallo $fname,\r\n\r\nKlik op de onderstaande link om uw emailadres te bevestigen.\r\n\r\n$confirmLink\r\n\r\nGroeten MyHyvesbook+"; $header = "From: MyHyvesbook+