From 30d1ef40f4ed4c2c91510d76044a74e89930875e Mon Sep 17 00:00:00 2001 From: Joey Lai Date: Wed, 25 Jan 2017 12:55:29 +0100 Subject: [PATCH 1/2] fixed js for login --- website/public/js/registerAndLogin.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/public/js/registerAndLogin.js b/website/public/js/registerAndLogin.js index 92d2281..87351bf 100644 --- a/website/public/js/registerAndLogin.js +++ b/website/public/js/registerAndLogin.js @@ -13,6 +13,6 @@ function bannedAlert(){ function emailNotConfirmed(userID){ if (confirm("Your email is not confirmed.\nPress ok to send another confirmation.") == true) { sendConfirmEmail(userID); - } + } } \ No newline at end of file From e840def73387ee904cee0f30a27646bff10e2840 Mon Sep 17 00:00:00 2001 From: Joey Lai Date: Wed, 25 Jan 2017 13:43:08 +0100 Subject: [PATCH 2/2] FIxed confirmation login --- website/public/js/registerAndLogin.js | 7 ++----- website/queries/login.php | 6 ++++-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/website/public/js/registerAndLogin.js b/website/public/js/registerAndLogin.js index 87351bf..ef49e83 100644 --- a/website/public/js/registerAndLogin.js +++ b/website/public/js/registerAndLogin.js @@ -10,9 +10,6 @@ function bannedAlert(){ alert("Your account is banned"); } -function emailNotConfirmed(userID){ - if (confirm("Your email is not confirmed.\nPress ok to send another confirmation.") == true) { - sendConfirmEmail(userID); - } - +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/queries/login.php b/website/queries/login.php index 2955942..2af255a 100644 --- a/website/queries/login.php +++ b/website/queries/login.php @@ -35,8 +35,9 @@ function validateLogin($username, $password){ window.onload=bannedAlert(); "; } else if ($role == "unconfirmed"){ + sendConfirmEmail(getUser()["userID"]); echo ""; } else { $_SESSION["userID"] = $userID; @@ -56,4 +57,5 @@ class loginException extends Exception parent::__construct($message, $code, $previous); } } -?> \ No newline at end of file +?> +