summaryrefslogtreecommitdiff
path: root/htdocs/validate.php
blob: d69510b78bc0f5952c7672cb8d2c6756a812bda8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php

/* Foursquare Community Site
 * 
 * Copyright (C) 2011 Foursquare Church.
 * 
 * Developers: Jesse Morgan <jmorgan@foursquarestaff.com>
 *
 */

require_once "src/base.inc.php";

require_once "src/header.inc.php";

echo "<h2>Email Verification</h2>";

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";

?>