Subversion Repositories ALCASAR

Rev

Rev 2852 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 2852 Rev 3254
Line 1... Line 1...
1
<?php
1
<?php
2
# $Id: admin_log.php 2852 2020-07-18 10:08:26Z rexy $
2
# $Id: admin_log.php 3254 2025-02-22 17:08:05Z rexy $
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)); 
Line 9... Line 9...
9
if ($Language === 'fr') {
9
if ($Language === 'fr') {
10
	$l_title	= "Connexion à l'ALCASAR Control Center (ACC)";
10
	$l_title	= "Connexion à l'ALCASAR Control Center (ACC)";
11
	$l_user		= "Utilisateur";
11
	$l_user		= "Utilisateur";
12
	$l_ip_address	= "Adresse IP";
12
	$l_ip_address	= "Adresse IP";
13
	$l_date         = "Date";
13
	$l_date         = "Date";
14
    $l_agent        = "Agent web";
14
	$l_agent        = "Agent web";
15
 
-
 
16
} else if ($Language === 'es') {
15
} else if ($Language === 'es') {
17
	$l_title	= "Conexiones a ALCASAR, Centro de Control (ACC)";
16
	$l_title	= "Conexiones a ALCASAR, Centro de Control (ACC)";
18
	$l_user		= "Usuario";
17
	$l_user		= "Usuario";
19
	$l_ip_address	= "Dirección IP";
18
	$l_ip_address	= "Dirección IP";
20
	$l_date         = "Fecha";
19
	$l_date         = "Fecha";
21
    $l_agent        = "Agente web";
20
	$l_agent        = "Agente web";
22
} else {
21
} else {
23
	$l_title	= "Connection to ALCASAR Control Center (ACC)";
22
	$l_title	= "Connection to ALCASAR Control Center (ACC)";
24
	$l_user		= "User";
23
	$l_user		= "User";
25
	$l_ip_address	= "IP address";
24
	$l_ip_address	= "IP address";
26
	$l_date         = "Date";
25
	$l_date         = "Date";
27
    $l_agent        = "Web user agent";
26
	$l_agent        = "Web user agent";
28
}
27
}
29
// Read access log
28
// Read access log
30
$accessLogs = [];
29
$accessLogs = [];
31
$accessLogFilename = '/var/Save/security/acc_access.log';
30
$accessLogFilename = '/var/Save/security/acc_access.log';
32
$filePtn = fopen($accessLogFilename, 'r');
31
$filePtn = fopen($accessLogFilename, 'r');
Line 65... Line 64...
65
<html>
64
<html>
66
<head>
65
<head>
67
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
66
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
68
	<title>Admin Logs</title>
67
	<title>Admin Logs</title>
69
	<link rel="stylesheet" href="/css/acc.css" type="text/css">
68
	<link rel="stylesheet" href="/css/acc.css" type="text/css">
-
 
69
	<link rel="stylesheet" href="/css/jquery.dataTables.css">
-
 
70
	<script src="/js/jquery-3.6.min.js"></script>
-
 
71
	<script src="/js/jquery.dataTables.js"></script>
-
 
72
	<script type="text/javascript">
-
 
73
		$(document).ready(function() {
-
 
74
		$('#datatable_display').DataTable();
-
 
75
		});
-
 
76
		$.extend(true, $.fn.dataTable.defaults, {
-
 
77
        		language: {
-
 
78
			url: '/js/jquery.dataTables.<?= $Language ?>.json'
-
 
79
        			},
-
 
80
			});
-
 
81
	</script>
70
</head>
82
</head>
71
<body>
83
<body>
72
<div class="panel">
84
<div class="panel">
73
	<div class="panel-header"><?= $l_title ?></div>
85
	<div class="panel-header"><?= $l_title ?></div>
74
	<div class="panel-row">
86
	<div class="panel-row">
75
		<table border=0 width=100% cellpadding=12 cellspacing=0 bgcolor="#ffffd0" valign=top>
87
		<table border=0 width=100% cellpadding=12 cellspacing=0 bgcolor="#ffffd0" valign=top>
76
		<tr><td>
88
		<tr><td>
77
			<TABLE width="100%" border=1 cellspacing=0 cellpadding=0>
89
			<TABLE id="datatable_display" class="display" width="100%" border=1 cellspacing=0 cellpadding=0>
78
			<tr>
90
			<thead><tr bgcolor=”#686464”>
79
				<th><?=$l_date?></th>
91
				<th><?=$l_date?></th>
80
				<th><?=$l_user?></th>
92
				<th><?=$l_user?></th>
81
				<th><?=$l_ip_address?></th>
93
				<th><?=$l_ip_address?></th>
82
				<th><?=$l_agent?></th>
94
				<th><?=$l_agent?></th>
-
 
95
			</tr></thead>
83
			</tr>
96
			<tbody>
84
			<?php if (empty($accessLogs)): ?>
97
			<?php if (empty($accessLogs)): ?>
85
			<tr>
98
			<tr>
86
				<td colspan="4"><center>Empty</center></td>
99
				<td colspan="4"><center>Empty</center></td>
87
			</tr>
100
			</tr>
88
			<?php else: ?>
101
			<?php else: ?>
Line 93... Line 106...
93
				<td><?= $access->ip ?></td>
106
				<td><?= $access->ip ?></td>
94
				<td><?= $access->user_agent ?></td>
107
				<td><?= $access->user_agent ?></td>
95
			</tr>
108
			</tr>
96
			<?php endforeach; ?>
109
			<?php endforeach; ?>
97
			<?php endif; ?>
110
			<?php endif; ?>
-
 
111
			</tbody>
98
			</table>
112
			</table>
99
		</table>
113
		</table>
100
	</div>
114
	</div>
101
</div>
115
</div>
102
</body>
116
</body>