This repository has been archived by the owner on Mar 17, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
/
menu.php
executable file
·135 lines (116 loc) · 3.83 KB
/
menu.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
128
129
130
131
132
133
134
<?php
/**
* Description of menu.php
* version: 1.0
* package: Dracker - Track and Trace
* copyright: Copyright (C) 2013 Gareth Phillips. All rights reserved.
* license: GNU/GPL, see license.htm.
*
* This file is part of the Dracker project.
*
* Dracker is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, under version 3 of the License.
*
* Dracker is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Dracker. If not, see <http://www.gnu.org/licenses/>.
*
* @author GPhillips
**/
ini_set("display_errors", 0);
ob_start();
include_once 'configs/DatabaseConnection.php';
$connection = new DatabaseConnection();
if (!isset($include_allowed)){die("<meta http-equiv='refresh' content='0;url=\"logout.php'>");};
session_start();
$sessionid= session_id();
$sessionid=sanitize($sessionid);
$date = date('Y-m-d H:i:s');
$time=time();
$time_check=$time-3600; //60 minutes
// if over 20 minutes and no new activity we remove the session from DB
$connection->executeQuery("DELETE FROM loggedin WHERE time<$time_check");
// Adds X-Frame-Options to HTTP header, so that page cannot be shown in an iframe.
header('X-Frame-Options: DENY');
// Adds X-Frame-Options to HTTP header, so that page can only be shown in an iframe of the same site.
header('X-Frame-Options: SAMEORIGIN');
function cleanInput($input) {
$search_input = array(
'@<script[^>]*?>.*?</script>@si', // Strip out javascript
'@<[\/\!]*?[^<>]*?>@si', // Strip out HTML tags
'@<style[^>]*?>.*?</style>@siU', // Strip style tags properly
'@<![\s\S]*?--[ \t\n\r]*>@' // Strip multi-line comments
);
$output = preg_replace($search_input, '', $input);
return $output;
}
function sanitize($input) {
if (is_array($input)) {
foreach($input as $var=>$val) {
$output[$var] = sanitize($val);
}
}
else {
if (get_magic_quotes_gpc()) {
$input = stripslashes($input);
}
$input = cleanInput($input);
$connection = new DatabaseConnection();
$output = mysql_real_escape_string($input);
}
return $output;
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<style>
body {
padding-top: 60px; /* When using the navbar-top-fixed */
}
</style>
<style>
/* To keep short panes open decently tall */
.tab-pane {min-height: 500px;}
.navbar2{
position:fixed;
}
html { overflow-y: scroll; font-size: 100%; -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; }
</style>
</head>
<div class="navbar2 navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a>
<a class="brand" href="#">Dracker v1.0</a>
<div class="nav-collapse">
<ul class="nav">
<li ><a href="view_results.php">Home</a></li>
</ul>
<a class="btn-flat smallnavbar pull-right" href="logout.php">Logout</a>
<div class="pull-right">
<ul class="nav pull-right">
</li>
</ul>
</div>
</ul>
</div><!-- /.nav-collapse -->
</div><!-- /.container -->
</div><!-- /navbar-inner -->
</div><!-- /navbar -->
<script type='text/javascript'>
$(document).ready(function(){
$('.dropdown-toggle').dropdown();
});
</script>