-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathactivate.php
More file actions
25 lines (24 loc) · 745 Bytes
/
activate.php
File metadata and controls
25 lines (24 loc) · 745 Bytes
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
<?php
require_once('./config/include.php');
require_once('./src/user_create_activate.php');
if (is_get_request()) {
if (isset($_GET['activation_code'])) {
$activation_code = $_GET['activation_code'];
$user = find_user_by_activation($dbc, $activation_code);
if ($user && $user['active'] === 0) {
activate_user($dbc, $activation_code);
$qparam = http_build_query(array('info' => 'activation_success'));
header('Location: login.php?' . $qparam);
}
else if ($user && $user['active'] === 1) {
$qparam = http_build_query(array('info' => 'already_verified'));
header('Location: login.php?' . $qparam);
} else {
header('Location: login.php');
}
}
else {
header('Location: login.php');
}
}
?>