Prevent multiple subscriptions when a subscription for that address is currently awaiting confirmation

master
Sven Slootweg 11 years ago
parent b36597761d
commit 4f8501d5b7

@ -44,6 +44,25 @@ if(empty($_POST['amount']) || preg_match("([0-9]*[.,][0-9]+|[0-9]+)", $_POST['am
return;
}
try
{
$exists = false;
Subscription::CreateFromQuery("SELECT * FROM subscriptions WHERE `EmailAddress` = :EmailAddress AND `Confirmed` = 0",
array(":EmailAddress" => $_POST['email']));
$exists = true;
}
catch (NotFoundException $e)
{
$exists = false;
}
if($exists)
{
flash_error("That e-mail address has subscribed before and is currently awaiting confirmation.");
require("modules/landing.php");
return;
}
try
{
$exists = false;

Loading…
Cancel
Save