Actionhandler geimplementeerd.
This commit is contained in:
@@ -140,7 +140,7 @@ Class Database{
|
||||
static function doesUserActivationKeyExist($activationKey){
|
||||
$con = Database::connectToDB();
|
||||
$query = $con->prepare("SELECT * FROM email_activation_keys WHERE activationkey = :activationKey");
|
||||
$query->bindParam(':activationKey', $activationKey, PDO::PARAM_STR, 256);
|
||||
$query->bindParam(':activationKey', $activationKey, PDO::PARAM_STR, 256);
|
||||
$query->execute();
|
||||
if($query->rowCount() == 0){
|
||||
//bestaat nog niet
|
||||
@@ -151,6 +151,16 @@ Class Database{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
static function registerActivationKey($users_id, $activationKey){
|
||||
$con = Database::connectToDB();
|
||||
$query = $con->prepare("INSERT INTO email_activation_keys (users_id, activationkey) VALUES (:users_id, :activationkey)");
|
||||
$query->bindParam(':users_id', $users_id);
|
||||
$query->bindParam(':activationkey', $activationKey);
|
||||
$query->execute();
|
||||
}
|
||||
|
||||
|
||||
|
||||
//Activeer gebruiker en verwijder activation key uit de activation key tabel
|
||||
static function activateUser($activationKey){
|
||||
$con = Database::connectToDb();
|
||||
|
||||
@@ -21,7 +21,6 @@ Class HUtils{
|
||||
return true;
|
||||
}
|
||||
static function sqlDateToPhpDate($date){
|
||||
|
||||
return new DateTime($date);
|
||||
}
|
||||
static function getPage($fetchmethod){
|
||||
@@ -42,5 +41,14 @@ Class HUtils{
|
||||
static function getSiteTitle(){
|
||||
return "hPHPForum";
|
||||
}
|
||||
static function generateRandomKey(){
|
||||
$token = "";
|
||||
$chars = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
||||
$verificationKey = "";
|
||||
for ($i=0; $i < 32 ; $i++) {
|
||||
$token .= $chars[rand(0, strlen($chars) - 1)];
|
||||
}
|
||||
return $token;
|
||||
}
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user