-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadmin.php
70 lines (59 loc) · 1.51 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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<?php
session_start();
include ('config.php');
mysql_connect($hostname, $username, $password) or die (mysql_error());
mysql_select_db($dbName) or die (mysql_error());
if (isset($_GET['logout']))
{
$query = "INSERT INTO `logs`(`action`, `user`, `timestamp`) VALUES ('LOGOUT','{$_SESSION['login']}',NOW())";
$sql2 = mysql_query($query) or die(mysql_error());
if (isset($_SESSION['user_id']))
unset($_SESSION['user_id']);
setcookie('login', '', 0, "/");
setcookie('password', '', 0, "/");
header('Location: admin.php');
exit;
}
if (isset($_SESSION['user_id']))
{
include ('modules/rcon.php');
include ('modules/tables/rows.php');
function slashes(&$el)
{
if (is_array($el))
foreach($el as $k=>$v)
slashes($el[$k]);
else $el = stripslashes($el);
}
if (isset($_GET["show"])){
$show = $_GET["show"];
}else{
$show = 0;
}
// Start: page-header
include ('modules/header.php');
// End page-header
if (isset($_GET['view'])){
include ('modules/'.$_GET["view"].'.php');
} else {
include ('modules/dashboard.php');
}
// Start: page-footer
include ('modules/footer.php');
// End page-footer
?>
</div>
<!-- end content -->
</div>
<!-- end content-outer........................................................END -->
<div class="clear"> </div>
</body>
</html>
<?php
}
else
{
include ('modules/login.php');
}
?>