This repository has been archived by the owner on Apr 2, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
activeacc.php
68 lines (67 loc) · 2.52 KB
/
activeacc.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
<?php
require_once("config.php");
$key = cleanthis(@$_GET['key']);
$status = cleanthis(@$_POST['status']);
if($status == "active")
{
$resp = $recaptcha->verify($_POST['g-recaptcha-response'], $_SERVER['REMOTE_ADDR']);
if($resp->isSuccess() or $usecaptcha == false)
{
$code = cleanthis($_POST['key']);
if(strlen($code) == 32)
{
$code = strtolower($code);
$params = array($code);
$sql = "SELECT * FROM Account WHERE VerificationToken = ?";
$opts = array( "Scrollable" => SQLSRV_CURSOR_KEYSET );
$result = sqlsrv_query($mssql, $sql, $params, $opts);
$result = sqlsrv_num_rows($result);
if($result == 1)
{
$params = array($code);
$loverandom = md5(md5(rand(0,9)).md5(rand(0,9).$code));
$sql = "UPDATE Account SET VerificationToken = '$loverandom', Authority = '0' WHERE VerificationToken = ?";
$result = sqlsrv_query($mssql, $sql, $params);
exit(header("Location: index.php?reg=active"));
}
else
exit(header("Location: index.php?reg=nokey"));
}
else
exit(header("Location: index.php?reg=notkey"));
}
else
exit(header("Location: index.php?reg=gfailkey"));
}
?>
<html>
<head>
<title><?=$title?></title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Cache-control" content="private">
<script src="./js/jquery.min.js"></script>
<script src="./js/bootstrap.min.js"></script>
<link rel="stylesheet" type="text/css" href="./css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="./css/style.min.css">
<link rel="stylesheet" type="text/css" href="./css/font-awesome.min.css">
<script src='https://www.google.com/recaptcha/api.js'></script>
</head>
<body>
<div id='cont'>
<form action='activeacc.php' method='POST'>
<div class='form-group'>
<label for='user'>Activation Code</label>
<input type='text' class='form-control' <?php if(strlen($key) == 32) echo "value='$key'";?> onfocus="this.removeAttribute('readonly');" pattern=".{32,32}" placeholder='Activation Code' name='key' required>
<p class="help-block">Your activation code from your mail address</p>
</div>
<?php
if($usecaptcha == true)
echo "<div style='display: block;text-align: center;text-align: -webkit-center;'><div class='g-recaptcha' id='googlechap' data-sitekey='$captchapublickey'></div></div>";
?>
<center><button type='submit' class='btn btn-success' name='status' value='active'>Active my account now!</button>
</form>
</div>
</body>
</html>