Finishing touches

Signed-off-by: Skylar "The Cobra" Widulski <cobra@vern.cc>
This commit is contained in:
Skylar "The Cobra" Widulski 2023-08-26 05:45:12 -04:00
parent fe17adaa38
commit 506fcadec9
Signed by untrusted user: cobra
GPG Key ID: 4FD8F812083FF6F9
2 changed files with 11 additions and 2 deletions

View File

@ -26,6 +26,7 @@
return $str;
}
$err = $email = $code = $code_err = '';
$confirmed = false;
if (!empty($_GET['action']))
if (!empty($_GET['email']))
if (filter_var(sanitize($_GET['email']), FILTER_VALIDATE_EMAIL))
@ -60,6 +61,7 @@
$message = "You have been " . ($_GET['action'] == "sub" ? "added to" : "removed from") . " the ~vern announcement mailing list";
mail($email, $subject, $message, $headers);
$confirmed = true;
} else {
$code_err = 'Incorrect code';
}
@ -96,7 +98,7 @@
<span><input type="submit" value="Submit" style="width:100px;height:40px;font-size:20px"></span>
</form><br>
<?php
} else {
} else if (!$confirmed) {
?>
<div class=h><h1 id=confirm>Confirm Action</h1> <a aria-hidden=true href=#confirm>#confirm</a></div>
<p>A confirmation code was sent to <?php echo htmlspecialchars($email); ?></p>
@ -113,6 +115,13 @@
<br>
<span><input type="submit" value="Confirm" style="width:100px;height:40px;font-size:20px"></span>
</form><br>
<?php
} else {
?>
<meta http-equiv="refresh" content="5;url=/en/" />
<div class=h><h1 id=thanks>Confirmed</h1> <a aria-hidden=true href=#thanks>#thanks</a></div>
<p>You have received an e-mail confirming the action as well.</p>
<p>You will be redirected back <a href=/en/>home</a> in 5 seconds.</p>
<?php
}
?>

View File

@ -154,7 +154,7 @@
<?php
} else {
?>
<meta http-equiv="refresh" content="5;url=http://<?php echo htmlspecialchars($_SERVER['HTTP_HOST']); ?>" />
<meta http-equiv="refresh" content="5;url=/en/" />
<div class=h><h1 id=thanks>Thank you for signing up.</h1> <a aria-hidden=true href=#thanks>#thanks</a></div>
<p>An admin will review your request, and an e-mail will be sent if your registration is successful.</p>
<p>You will be redirected back <a href=/en/>home</a> in 5 seconds.</p>