forked from Git-Host/vpn
-
Notifications
You must be signed in to change notification settings - Fork 0
/
admin.php
executable file
·127 lines (114 loc) · 4.06 KB
/
admin.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
115
116
117
118
119
120
121
122
123
124
125
126
127
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>PPVSWA</title>
<style type="text/css">
body {
background-color: #fff4f4;
font-family: sans-serif;
color: teal;
}
h4 {
color: navy;
}
</style>
<script type="text/javascript" src="md5.js"></script>
<!--script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script-->
<script type="text/javascript">
function enAuth(id)
{
var url = "./auth.php?action=enauth&operateid=" + id
var sitepassword ="&sitepassword=<?php echo $_GET['sitepassword']; ?>"
url=url+sitepassword
url=url+"&random="+Math.random()
var div_id = "idstate" + id
loadState(url,div_id)
}
function deAuth(id)
{
var url = "./auth.php?action=deauth&operateid=" + id
var sitepassword ="&sitepassword=<?php echo $_GET['sitepassword']; ?>"
var div_id
url=url+sitepassword
url=url+"&random="+Math.random()
div_id = "idstate" + id
loadState(url,div_id)
}
/*function stateChanged(thing,div_id)
{
if (thing.readyState != 4 )
{
document.getElementById(div_id).innerHTML="^_^"
}
if (thing.readyState == 4 )
{
document.getElementById(div_id).innerHTML= thing.responseText
}
}
*/
function loadState(url,div_id)
{
var xmlHttp = GetXmlHttpObject();
//xmlHttp.onreadystatechange = stateChanged(xmlHttp,div_id);
document.getElementById(div_id).innerHTML = "N/A";
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
/*$.get (url);
$(div_id).html("N/A");*/
}
function GetXmlHttpObject()
{
var xmlHttp=null;
try
{
// Firefox, Opera 8.0+, Safari
xmlHttp=new XMLHttpRequest();
}
catch (e)
{
// Internet Explorer
try
{
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e)
{
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
}
return xmlHttp;
}
function makemail(id)
{
var url
url = "mailmaker.php?sitepassword=<?php echo $_GET['sitepassword'];?>&mailid="
url = url + id
window.open (url, 'makemail', 'height=400, width=450, top=60, left=60, toolbar=no, menubar=no, scrollbars=yes, resizable=yes,location=yes, status=yes')
}
</script>
</head>
<body>
<?php
require ("config.php");
$sitepassword = md5(md5($sitepassword,false),false);
if ($_GET['sitepassword'] == $sitepassword)
{
$db = mysql_connect($dbserver,$dbuser,$dbpassword);
mysql_select_db($dbname,$db);
$sql = "SELECT * FROM vpn ORDER BY date DESC ;";
$result = mysql_query($sql);
echo "<h4>Public PPTP VPN Server Web Authorize system.</h4><p><a href=\"javascript:makemail('ALL')\">Send Message To All</a> <a href=\"./auth.php?action=rebuildsecret&sitepassword=" . $_GET['sitepassword'] . "\">REBUILD Secret File</a> <a href=\"./viewkey.php?sitepassword=" . $_GET['sitepassword'] . "\">View Unused Activation Keys.</a> <a href=\"./auth.php?action=analyzelog&sitepassword=" . $_GET['sitepassword'] . "\">Analyze Log File</a><br />Note:Secret File Rebuild Needed After You Modify Authorizations.</p><table width=\"100%\" border=\"1\"><tr><th>ID</th><th>email</th><th>Password</th><th>IP</th><th>DateTime</th><th>Reason</th><th>Time</th><th>Data</th><th>State</th><th>Action</th></tr>";
while ($row = mysql_fetch_assoc($result))
{
echo "<tr><td><h4>" . $row['id'] . " </h4></td><td> " . $row['name'] . " </td><td>" . $row['passwd'] . "</td><td> " . $row['ip'] . "</td><td>" . date("D j F Y g.iA", strtotime($row['date'])) . "</td><td>";
echo $row['reason'];
echo "</td><td>" . $row['time'] . "</td><td>" . $row['data'] . "</td><td id=\"idstate" . $row['id'] . "\">" . $row['state'] . "</td><td><a href=\"javascript: enAuth(" . $row['id'] . ")\">Authorize</a><br /><a href=\"javascript: deAuth(" . $row['id'] . ")\">Deauthorize</a><br /><a href=\"javascript:makemail(" . $row['id'] . ")\">Send Message</a></td></tr>";
}
echo "</table>";
}
else
echo "<script type=\"text/javascript\" src=\"md5.js\"></script><form action=\"./admin.php\" method=\"GET\"><table><p>Admin Login</p><tr><td><input type=\"password\" name=\"sitepassword\" id=\"sitepassword\" value=\"\" /></td></tr><tr><td><input type=\"submit\" value=\"Login\" onclick=\"encode()\" /></td></tr></table></form>";
?>
</body>
</html>