-
Notifications
You must be signed in to change notification settings - Fork 0
/
verify.php
114 lines (106 loc) · 3.03 KB
/
verify.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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
<?php
require_once 'functions.php';
if(isset($_GET['upload'])){
if(!count($_FILES)){
die('file upload failed');
}
$file = array_shift($_FILES);
if($file['error']){
die('file upload failed');
}
$hash = trim(file_get_contents($file['tmp_name']));
if(getDeviceIdentity()===$hash){
@unlink('license.key');
@rename($file['tmp_name'], 'license.key');
die('ok');
}else{
die('Invalid license');
}
}
?>
<!doctype html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>Verify</title>
<link type="text/css" rel="stylesheet" href="assets/css/jquery.drag.drop.css">
<script type="text/javascript" src="assets/js/jquery-3.1.0.min.js"></script>
<script type="text/javascript" src="assets/js/jquery.drag.drop.js"></script>
<script type="text/javascript">
var afterUploaded = function(resp) {
if(resp == 'ok'){
location.href = 'index.php';
}else{
alert(resp)
}
};
$(document).ready(function() {
$('input[type="file"]').dropUpload({
'uploadUrl' : '?upload=1',
'uploaded' : afterUploaded,
'dropClass' : 'file-drop',
'dropHoverClass': 'file-drop-hover',
'defaultText' : '<h1>Drag & Drop license file or click here!</h1>',
'hoverText' : ''
});
$('.file-drop').click(function(){
$('input[type="file"]').click()
})
});
</script>
</head>
<body>
<h1 style="text-align: center;">APP Verification</h1>
<form action="#" method="post" enctype="multipart/form-data">
<input class="file-controller" type="file" name="license-file" accept="*.key">
<input type="submit" value="Upload!" class="submit">
</form>
<style>
form{
width: 60%;
margin:auto;
text-align:center;
}
.file-controller{
visibility: hidden;
}
.file-drop{
border: 0.25rem dashed #A5A5C7;
cursor: default;
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
padding: 3rem!important;
text-align: center!important;
color: gray;
}
.submit{
visibility: hidden;
display: inline-block;
font-weight: 400;
text-align: center;
white-space: nowrap;
vertical-align: middle;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
border: 1px solid transparent;
padding: .375rem .75rem;
font-size: 1rem;
line-height: 1.5;
border-radius: .25rem;
transition: color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;
color: #fff;
background-color: #007bff;
border-color: #007bff;
cursor: pointer;
margin-top: 10px;
width:100%;
}
</style>
</body>
</html>