Added confirmation login email #122
@@ -9,3 +9,10 @@ function checkLoggedIn() {
|
|||||||
function bannedAlert(){
|
function bannedAlert(){
|
||||||
alert("Your account is banned");
|
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");
|
require_once("../queries/connect.php");
|
||||||
include_once("../queries/login.php");
|
include_once("../queries/login.php");
|
||||||
include_once("../queries/checkInput.php");
|
include_once("../queries/checkInput.php");
|
||||||
|
include_once("../queries/emailconfirm.php");
|
||||||
?>
|
?>
|
||||||
<body>
|
<body>
|
||||||
<?php
|
<?php
|
||||||
@@ -23,7 +24,7 @@
|
|||||||
// Trying to login
|
// Trying to login
|
||||||
if ($_SERVER["REQUEST_METHOD"] == "POST") {
|
if ($_SERVER["REQUEST_METHOD"] == "POST") {
|
||||||
try{
|
try{
|
||||||
$uname = strtolower(test_input($_POST["uname"]));
|
$uname = ($_POST["uname"]);
|
||||||
validateLogin($_POST["uname"], $_POST["psw"]);
|
validateLogin($_POST["uname"], $_POST["psw"]);
|
||||||
} catch(loginException $e) {
|
} catch(loginException $e) {
|
||||||
$loginErr = $e->getMessage();
|
$loginErr = $e->getMessage();
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
require_once("../queries/connect.php");
|
require_once("../queries/connect.php");
|
||||||
include_once("../queries/register.php");
|
include_once("../queries/register.php");
|
||||||
include_once("../queries/checkInput.php");
|
include_once("../queries/checkInput.php");
|
||||||
|
include_once("../queries/emailconfirm.php");
|
||||||
?>
|
?>
|
||||||
<body>
|
<body>
|
||||||
<?php
|
<?php
|
||||||
@@ -91,6 +92,7 @@
|
|||||||
try {
|
try {
|
||||||
getIp();
|
getIp();
|
||||||
registerCheck($correct);
|
registerCheck($correct);
|
||||||
|
sendConfirmEmailUsername($username);
|
||||||
} catch(registerException $e){
|
} catch(registerException $e){
|
||||||
$genericErr = $e->getMessage();
|
$genericErr = $e->getMessage();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,6 +34,10 @@ function validateLogin($username, $password){
|
|||||||
echo "<script>
|
echo "<script>
|
||||||
window.onload=bannedAlert();
|
window.onload=bannedAlert();
|
||||||
</script>";
|
</script>";
|
||||||
|
} else if ($role == "unconfirmed"){
|
||||||
|
echo "<script>
|
||||||
|
window.onload=emailNotConfirmed('userID');
|
||||||
|
</script>";
|
||||||
} else {
|
} else {
|
||||||
$_SESSION["userID"] = $userID;
|
$_SESSION["userID"] = $userID;
|
||||||
header("location: profile.php");
|
header("location: profile.php");
|
||||||
|
|||||||
Reference in New Issue
Block a user