-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathactivate.php
More file actions
43 lines (37 loc) · 1.13 KB
/
Copy pathactivate.php
File metadata and controls
43 lines (37 loc) · 1.13 KB
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
40
41
42
43
<?php
include 'core/init.php';
logged_in_redirect();
include 'includes/overall/overall_header.php';
if (isset($_GET['success']) === true && empty($_GET['success']) === true) {
?>
<h2>We have activated your account!</h2>
<p>Please log in on the right to check out all the cool stuff.</p>
<?php
} else if (isset($_GET['email'], $_GET['email_code']) === true) {
$email = trim($_GET['email']);
$email_code = trim($_GET['email_code']);
if (email_exists($email) === false) {
$errors[] = 'We could not find that email address';
} else if (activate($email, $email_code) === false) {
$errors[] = 'We had a problem activating your account.';
}
if (empty($errors) === false) {
?>
<H2>Oops...</h2>
<?php
echo output_errors($errors);
} else {
?>
<h2>We have activated your account!</h2>
<p>Please log in on the right to check out all the cool stuff.</p>
<?php
echo '<meta HTTP-EQUIV="REFRESH" content="0; url=activate.php?success">';
exit();
}
} else {
//dispay error and redirect
echo '<meta HTTP-EQUIV="REFRESH" content="0; url=index.php">';
exit();
}
include 'includes/overall/overall_footer.php';
?>