forked from R4Z0R49/DayZAdmin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
admin.php
79 lines (69 loc) · 1.54 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
<?php
session_start();
require_once('config.php');
require_once('db.php');
require_once('functions.php');
require_once('queries.php');
include_once('modules/FlashMessages.class.php');
$message = new FlashMessages();
$page = 'dashboard';
if(isset($_SESSION['login'])) {
$User = $_SESSION['login'];
$User_query = $db->GetAll("SELECT * FROM users WHERE login = ?", $User);
$salt = $User_query[0]['salt'];
}
if (isset($_GET['logout']))
{
$db->Execute("INSERT INTO `logs`(`action`, `user`, `timestamp`) VALUES ('LOGOUT',?,NOW())", $_SESSION['login']);
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);
}
// Start: page-header
include ('modules/header.php');
// End page-header
if (isset($_GET["show"])) {
$show = $_GET["show"];
} else {
$show = 0;
}
if (isset($_GET['view'])){
include ('modules/'.$_GET["view"].'.php');
} else {
include ('modules/dashboard.php');
}
?>
</div>
<!-- end content -->
</div>
<!-- end content-outer........................................................END -->
</div>
<!-- end wrapper -->
<?php
// Start: page-footer
include('modules/footer.php');
// End page-footer
?>
</body>
</html>
<?php
}
else
{
include ('modules/login.php');
}
?>