Subversion Repositories ALCASAR

Rev

Rev 2267 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 2267 Rev 2268
Line 1... Line 1...
1
<?php
1
<?php
2
# $Id: admin_log.php 2267 2017-06-04 09:28:36Z richard $
2
# $Id: admin_log.php 2268 2017-06-04 10:12:10Z richard $
3
 
3
 
4
$Language = 'en';
4
$Language = 'en';
5
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
5
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
6
	$Langue = explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']);
6
	$Langue = explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']);
7
	$Language = strtolower(substr(chop($Langue[0]), 0, 2)); 
7
	$Language = strtolower(substr(chop($Langue[0]), 0, 2)); 
8
}
8
}
9
 
-
 
10
if ($Language === 'fr') {
9
if ($Language === 'fr') {
11
	$l_title_amdin_log = "Connexion à l'ALCASAR Control Center (ACC)";
10
	$l_title	= "Connexion à l'ALCASAR Control Center (ACC)";
-
 
11
	$l_user		= "Utilisateur";
-
 
12
	$l_ip_address	= "Adresse IP";
12
} else {
13
} else {
13
	$l_title_amdin_log = "Connection to ALCASAR Control Center (ACC)";
14
	$l_title	= "Connection to ALCASAR Control Center (ACC)";
-
 
15
	$l_user		= "User";
-
 
16
	$l_ip_address	= "IP address";
14
}
17
}
15
 
-
 
16
// Read access log
18
// Read access log
17
$accessLogs = [];
19
$accessLogs = [];
18
$accessLogFilename = '/var/Save/security/acc_access.log';
20
$accessLogFilename = '/var/Save/security/acc_access.log';
19
$filePtn = fopen($accessLogFilename, 'r');
21
$filePtn = fopen($accessLogFilename, 'r');
20
if ($filePtn !== false){
22
if ($filePtn !== false){
Line 46... Line 48...
46
		}
48
		}
47
	}
49
	}
48
}
50
}
49
 
51
 
50
?>
52
?>
51
<!doctype html>
53
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
52
<html>
54
<html>
53
<head>
55
<head>
54
	<meta charset="utf-8">
56
	<meta charset="utf-8">
55
	<title>Admin Logs</title>
57
	<title>Admin Logs</title>
56
	<link rel="stylesheet" type="text/css" href="../css/bootstrap.min.css">
58
	<link rel="stylesheet" href="/css/style.css" type="text/css">
57
	<style>
59
	<style>
58
	body {
60
	body {
59
		background-color: #EFEFEF;
61
		background-color: #EFEFEF;
60
	}
62
	}
61
	</style>
63
	</style>
62
	<script src="../js/jquery.min.js"></script>
-
 
63
	<script src="../js/bootstrap.min.js"></script>
-
 
64
</head>
64
</head>
65
<body>
65
<body>
-
 
66
<TABLE width="100%" border="0" cellspacing="0" cellpadding="0">
-
 
67
<tr><th><? echo "$l_title";?></th></tr>
-
 
68
<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" 
66
	<div class="container">
69
height="2"></td></tr>
-
 
70
</TABLE>
-
 
71
<TABLE width="100%" border=1 cellspacing=0 cellpadding=0>
-
 
72
	<thead>
67
		<center>
73
		<tr>
-
 
74
			<th>Date</th>
-
 
75
			<th><?=$l_user?></th>
68
			<h3><?= $l_title_amdin_log ?></h3>
76
			<th><?=$l_ip_address?></th>
-
 
77
			<th>Agent</th>
69
		</center>
78
		</tr>
-
 
79
	</thead>
-
 
80
	<tbody>
70
		<table class="table table-striped">
81
		<?php if (empty($accessLogs)): ?>
71
			<thead>
82
			<tr>
-
 
83
				<td colspan="4"><center>Empty</center></td>
-
 
84
			</tr>
-
 
85
		<?php else: ?>
-
 
86
			<?php foreach ($accessLogs as $access): ?>
72
				<tr>
87
			<tr>
73
					<th>Date</th>
88
					<td><?= $access->date ?></td>
74
					<th>User</th>
89
					<td><?= $access->username ?></td>
75
					<th>IP address</th>
90
					<td><?= $access->ip ?></td>
76
					<th>Agent</th>
91
					<td><?= $access->user_agent ?></td>
77
				</tr>
92
				</tr>
78
			</thead>
-
 
79
			<tbody>
-
 
80
				<?php if (empty($accessLogs)): ?>
-
 
81
					<tr>
-
 
82
						<td colspan="3"><center>Empty</center></td>
-
 
83
					</tr>
-
 
84
				<?php else: ?>
-
 
85
					<?php foreach ($accessLogs as $access): ?>
-
 
86
						<tr>
-
 
87
							<td><?= $access->date ?></td>
-
 
88
							<td><?= $access->username ?></td>
-
 
89
							<td><?= $access->ip ?></td>
-
 
90
							<td><?= $access->user_agent ?></td>
-
 
91
						</tr>
-
 
92
					<?php endforeach; ?>
93
			<?php endforeach; ?>
93
				<?php endif; ?>
94
		<?php endif; ?>
94
			</tbody>
95
	</tbody>
95
		</table>
96
</table>
96
	</div>
-
 
97
</body>
97
</body>
98
</html>
98
</html>