Subversion Repositories ALCASAR

Rev

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

Rev 2182 Rev 2267
Line 1... Line 1...
1
<?php
1
<?php
2
# $Id: haut.php 2182 2017-04-25 22:10:46Z tom.houdayer $
2
# $Id: haut.php 2267 2017-06-04 09:28:36Z richard $
3
 
-
 
4
// Access counter incrementation
-
 
5
$counterFilename = 'compteur.txt';
-
 
6
$fp = fopen($counterFilename, 'r+');
-
 
7
if ($fp === false) {
-
 
8
	exit();
-
 
9
}
-
 
10
$nbAccess = intval(fgets($fp, 10));
-
 
11
$nbAccess++;
-
 
12
rewind($fp);
-
 
13
fputs($fp, $nbAccess.PHP_EOL); 
-
 
14
fclose($fp);
-
 
15
 
3
 
16
// Inform admin log about his last connection
4
// Inform admin log about his last connection
17
$admin_log = 'admin_log.txt';
5
$admin_log = '/var/Save/security/acc_access.log';
18
$user_htdigest = $_SERVER['PHP_AUTH_USER'];
6
$user_htdigest = $_SERVER['PHP_AUTH_USER'];
19
$date_system = date('d/m/Y H:i:s');
7
$date_system = date('d/m/Y H:i:s');
20
$user_ip = $_SERVER['REMOTE_ADDR'];
8
$user_ip = $_SERVER['REMOTE_ADDR'];
-
 
9
$user_agent = $_SERVER['HTTP_USER_AGENT'];
21
$text = $date_system . '|||' . $user_htdigest . '|||' . $user_ip;
10
$text = $date_system . '|' . $user_htdigest . '|' . $user_ip . '|' . $user_agent;
22
file_put_contents($admin_log, $text.PHP_EOL, FILE_APPEND);
11
file_put_contents($admin_log, $text.PHP_EOL, FILE_APPEND);
23
 
-
 
24
?>
12
?>
25
<!doctype html>
13
<!doctype html>
26
<!-- Writen by Rexy -->
14
<!-- Writen by Rexy -->
27
<!-- ACC Top Window -->
15
<!-- ACC Top Window -->
28
<html>
16
<html>