|
Server : Apache/2.4.62 System : FreeBSD fbsdweb2.web.rcn.net 14.1-RELEASE FreeBSD 14.1-RELEASE releng/14.1-n267679-10e31f0946d8 GENERIC amd64 User : www ( 80) PHP Version : 8.3.8 Disable Function : NONE Directory : /domains/conceptlabs1/classes/ |
Upload File : |
<?php
/**
* Common class to set online flag of user
*/
class Online
{
/**
* function to set online flag of user
* @param filepath path to file
*/
function setOnline($filepath)
{
$mtime = @ filemtime($filepath);
if(! file_exists($filepath) || ($mtime && $mtime < strtotime("-30 seconds"))) {
file_put_contents($filepath, json_encode(array('lastseen'=>gmdate('Y-m-d H:i:s'))));
@ chmod($filepath, 0774);
}
}
}
?>