summaryrefslogtreecommitdiff
path: root/htdocs/validate.php
diff options
context:
space:
mode:
Diffstat (limited to 'htdocs/validate.php')
-rw-r--r--htdocs/validate.php22
1 files changed, 21 insertions, 1 deletions
diff --git a/htdocs/validate.php b/htdocs/validate.php
index 272640b..d69510b 100644
--- a/htdocs/validate.php
+++ b/htdocs/validate.php
@@ -14,6 +14,26 @@ require_once "src/header.inc.php";
echo "<h2>Email Verification</h2>";
-if (isset($_POST
+if (isset($_GET['id'])) {
+ $id = addslashes($_GET['id']);
+ $post = Post::getBySecretId($id);
+
+ if ($post) {
+ $post->verify();
+ $post->save();
+
+ echo "<p>Your email address has been validated. Your post will be listed"
+ . " as soon as we approve the content. You will recieve an email when"
+ . " the post is approved.</p>";
+
+ } else {
+ echo "<div class=\"error\">Invalid validation ID provided.</div>";
+ }
+
+} else {
+ echo "<div class=\"error\">No validation ID provided.</div>";
+}
+
+require_once "src/footer.inc.php";
?>