Email confirm and password change now use messagepage function.

This commit is contained in:
Marijn Jansen
2017-01-26 12:05:28 +01:00
parent 6a882bf78d
commit 44f86a4fbb
4 changed files with 77 additions and 59 deletions

View File

@@ -1,5 +1,6 @@
<?php
include_once("../queries/connect.php");
include_once("../views/messagepage.php");
if (array_key_exists("u", $_GET) and array_key_exists("h", $_GET)) {
$checkHash = $GLOBALS["db"]->prepare("
SELECT
@@ -18,11 +19,11 @@ if (array_key_exists("u", $_GET) and array_key_exists("h", $_GET)) {
if ($role == "unconfirmed") {
doActivate($email);
} else {
echo "Ongeldige link.";
messagePage("Ongeldige link.");
}
} else {
echo "Ongeldige link.";
messagePage("Ongeldige link.");
}
function doActivate(string $email) {
@@ -39,11 +40,10 @@ function doActivate(string $email) {
$confirmUser->bindParam(":userID", $_GET["u"]);
$confirmUser->execute();
if ($confirmUser->rowCount()) {
echo "Email bevestigd <br />
<a href='index.php'>U wordt automatisch doorgestuurd naar de login pagina over 5 seconden.</a> ";
header("refresh:5;url=login.php");
messagePage("Email bevestigd <br />
<a href='index.php'>Klik hier om terug te gaan naar de login pagina.</a>");
}
} else {
echo "Ongeldige link.";
messagePage("Ongeldige link.");
}
}