2012-11-22, 04:25 PM
Not MyBB
I have a column in my users table for 'online' which updates every 90 minutes with the last time they were online and it displays it like:
2012-11-22 19:15:18
How would I go about stopping people logging in if that user has been online within the last 90 minutes?
People are currently abusing my system by gaining x10 the legitimate amount of site currency by logging in on multiple PC's / Browsers.
I think MyBB use a similar sort of function but I've never tried multi-logging with the same account on a MyBB forum.
Would anybody know how to do this?
Edit:
There is a function to check if they're online but I don't know if that helps:
I have a column in my users table for 'online' which updates every 90 minutes with the last time they were online and it displays it like:
2012-11-22 19:15:18
How would I go about stopping people logging in if that user has been online within the last 90 minutes?
People are currently abusing my system by gaining x10 the legitimate amount of site currency by logging in on multiple PC's / Browsers.
I think MyBB use a similar sort of function but I've never tried multi-logging with the same account on a MyBB forum.
Would anybody know how to do this?
Edit:
There is a function to check if they're online but I don't know if that helps:
/* User Session */
$is_online = (isset($_SESSION['EX_login']) ? true : false);
if(isset($_SESSION['EX_login'])){
$sql = $db->Query("SELECT *,UNIX_TIMESTAMP(`online`) AS `online` FROM `users` WHERE (`login`='".$_SESSION['EX_login']."' OR `email`='".$_SESSION['EX_login']."')");
$data = $db->FetchArray($sql);
if($data['id'] == ''){
session_destroy();
}elseif($data['online']+90 < time()){
$db->Query("UPDATE `users` SET `online`=NOW() WHERE `id`='".$data['id']."'");
}
}