Added confirmation login email #122

Merged
11057122 merged 1 commits from joey-testing into master 2017-01-25 12:49:47 +01:00
4 changed files with 15 additions and 1 deletions

View File

@@ -8,4 +8,11 @@ function checkLoggedIn() {
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);
}
}

View File

@@ -5,6 +5,7 @@
require_once("../queries/connect.php");
include_once("../queries/login.php");
include_once("../queries/checkInput.php");
include_once("../queries/emailconfirm.php");
?>
<body>
<?php
@@ -23,7 +24,7 @@
// Trying to login
if ($_SERVER["REQUEST_METHOD"] == "POST") {
try{
$uname = strtolower(test_input($_POST["uname"]));
$uname = ($_POST["uname"]);
validateLogin($_POST["uname"], $_POST["psw"]);
} catch(loginException $e) {
$loginErr = $e->getMessage();

View File

@@ -5,6 +5,7 @@
require_once("../queries/connect.php");
include_once("../queries/register.php");
include_once("../queries/checkInput.php");
include_once("../queries/emailconfirm.php");
?>
<body>
<?php
@@ -91,6 +92,7 @@
try {
getIp();
registerCheck($correct);
sendConfirmEmailUsername($username);
} catch(registerException $e){
$genericErr = $e->getMessage();
}

View File

@@ -34,6 +34,10 @@ function validateLogin($username, $password){
echo "<script>
window.onload=bannedAlert();
</script>";
} else if ($role == "unconfirmed"){
echo "<script>
window.onload=emailNotConfirmed('userID');
</script>";
} else {
$_SESSION["userID"] = $userID;
header("location: profile.php");