/web/js/statusControler.js |
---|
119,7 → 119,7 |
hidePage("waitPage"); |
hidePage("errorPage"); |
//For no compliant browser with these javascript functions : onbeforeunload and unload, to disconnect users whose close status.php window. Now, we check if user is still connected while he is joinning 'still_connected.php' |
//We check if user is still connected while he gets 'still_connected.php' |
var xhttp = new XMLHttpRequest(); |
xhttp.open('GET','still_connected.php',true); |
xhttp.send(); |
/web/still_connected.php |
---|
1,5 → 1,5 |
<?php |
// this script is executed by status page (controler.js) of each users |
// store user @IP who can join this page (still have their status.php tab open) in a file. |
$filename = '/tmp/current_users.txt'; |
$user_ip = $_SERVER['REMOTE_ADDR']; |
24,7 → 24,6 |
} |
} |
fclose($fh); |
// else we write user IP in the file |
if (!$found) { |
file_put_contents($filename, $user_ip.':TEMP'.PHP_EOL, FILE_APPEND); |