function checkAndRemoveInactive() {
// Remove inactive users every inactiveCheckInterval:
if(!$this->getInactiveCheckTimeStamp() || ((time() - $this->getInactiveCheckTimeStamp()) > $this->getConfig('inactiveCheckInterval')*60)) {
$this->removeInactive();
$this->setInactiveCheckTimeStamp(time());
}
}
function removeInactive() {
$sql = 'SELECT
userID,
userName,
channel
FROM
'.$this->getDataBaseTable('online').'
WHERE
NOW() > DATE_ADD(dateTime, interval '.$this->getConfig('inactiveTimeout').' MINUTE);';
// Create a new SQL query:
$result = $this->db->sqlQuery($sql);
// Stop if an error occurs:
if($result->error()) {
echo $result->getError();
die();
}
if($result->numRows() > 0) {
$condition = '';
while($row = $result->fetch()) {
if(!empty($condition))
$condition .= ' OR ';
// Add userID to condition for removal:
$condition .= 'userID='.$this->db->makeSafe($row['userID']);
// Update the socket server authentication for the kicked user:
if($this->getConfig('socketServerEnabled')) {
$this->updateSocketAuthentication($row['userID']);
}
$this->removeUserFromOnlineUsersData($row['userID']);
// Insert logout timeout message:
$text = '/logout '.$row['userName'].' Timeout';
$this->insertChatBotMessage(
$row['channel'],
$text,
null,
1
);
}
$result->free();
$sql = 'DELETE FROM
'.$this->getDataBaseTable('online').'
WHERE
'.$condition.';';
// Create a new SQL query:
$result = $this->db->sqlQuery($sql);
// Stop if an error occurs:
if($result->error()) {
echo $result->getError();
die();
}
}
}
To my knowledge no one has gotten phpbb 3.1.x fully working with no errors. Session problems still exist and not likely to be fixed anytime soon. Frug, who has been developing it, hasn't been answering mails for a while now.
--
You received this message because you are subscribed to the Google Groups "AJAX-chat" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ajax-chat+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.