-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathactivate_account.php
76 lines (55 loc) · 2.03 KB
/
activate_account.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<?php
require_once 'session-validation.php';
$error = array();
if(isset($_GET['x'], $_GET['code']) === true) {
include_once 'core/patient/patient.inc.php';
$email = trim($_GET['x']);
$code = trim($_GET['code']);
#echo $email . ' account activated, with code ' . $code;
if (is_member_exist_by_email($email)) {
if (is_code_and_user_valid($email, $code)) {
if(!active_account_by_email($email)) {
$error['already'] = 'Account already activated';
#echo 'account already activated';
}
} else {
$error['invalid'] = 'Invalid Information';
#echo 'Invalid Information Provided';
}
} else {
$error['incorrect'] = 'Email Incorrect';
#echo 'email incorrect';
}
} else {
$error['incorrect'] = 'Acount was not activated';
#echo 'Acount was not activated';
}
include 'patient-header.php';
?>
<div class="container content">
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title"> <b>Account Activation</b></h4>
</div>
<div id="collapse4" class="panel-collapse">
<div class="panel-body">
<?php
if (empty($error)){
$text = "Account Successfully Activated";
$type = 'text-info';
} else {
$text = reset($error);
$text = "Activation Failed: ".$text;
$type = 'text-danger';
}?>
<p class=<?php echo $type; ?>>
<?php echo $text; ?>
</p>
<p>Go to <a href="sign-up.php">Sign In</a> page</p>
</div>
</div>
</div>
</div>
<div class="container full-height">
</div>
<?php include 'footer.php' ?>