Added confirmation login email
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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();
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user