Subversion Repositories ALCASAR

Rev

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

Rev 2883 Rev 3173
Line 1... Line 1...
1
<?php
1
<?php
2
// this script is executed by status page (controler.js) of each users
2
// this script is executed by status page (controler.js) of each users
3
// store user @IP who can join this page (still have their status.php tab open) in a file.
3
// store user @IP who can join this page (still have their status.php tab open) in a file.
4
$filename = '/tmp/current_users.txt';
4
$filename = '/tmp/current_users.txt';
5
$user_ip = $_SERVER['REMOTE_ADDR'];
5
$user_ip = $_SERVER['REMOTE_ADDR'];
-
 
6
if (!filter_var($user_ip, FILTER_VALIDATE_IP)){
-
 
7
	echo "<b>invalide @IP</b><br />\n";
-
 
8
	exit();
-
 
9
}
6
 
10
 
7
$isConnected = exec('sudo /usr/sbin/chilli_query list | awk '.escapeshellarg('($2 == "'.$user_ip.'") {print $5}'));
11
$isConnected = exec('sudo /usr/sbin/chilli_query list | awk '.escapeshellarg('($2 == "'.$user_ip.'") {print $5}'));
8
if ($isConnected === '0') {
12
if ($isConnected === '0') {
9
	exit();
13
	exit();
10
}
14
}