-
Notifications
You must be signed in to change notification settings - Fork 31
/
activate.php
39 lines (33 loc) · 1015 Bytes
/
activate.php
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
include "core/init.php";
logged_in_redirect();
include "includes/overall/header.php";
if (isset($_GET['success']) === true && empty($_GET['success']) === true) {
?>
<h2>Thanks, we've activated your account...</h2>
<p>You're free to log in!</p>
<?php
} else if (isset($_GET['email'], $_GET['email_code']) === true) {
// echo 'set';
$email = trim($_GET['email']);
$email_code = trim($_GET['email_code']);
if (email_exists($email) === false) {
$errors[] = 'Oops, something went wrong, and we couldn\'t find that email address';
} else if (activate($email, $email_code) === false) {
$errors[] = 'We had problems activating your account';
}
if (empty($errors) === false) {
?>
<h2>Oops...</h2>
<?php
echo output_errors($errors);
} else {
header('Location: activate.php?success');
exit();
}
} else {
header('Location: index.php');
exit();
}
include "includes/overall/footer.php";
?>