Ticket #438 (closed Bug report: fixed)
function getNumOnlineUsers() in classes/Node.php (incorrectly counts users using the same login)
Reported by: | andrewhodel@… | Owned by: | |
---|---|---|---|
Priority: | low | Milestone: | Not yet assigned to a Milestone |
Component: | Auth server, Statistics and reporting | Version: | |
Keywords: | Cc: |
Description
I don't understand the logic behind this, but the function performs a different query if the node isConfiguredSplashOnly(). The difference being counting users by mac, or counting users by login.
It seems logical to me to count users by mac by default? Another solution would be to count by mac if the allow multiple login flag is on for the network?
public function getNumOnlineUsers() {
$db = AbstractDb::getObject();
// Init values $retval = array (); $row = null;
#if (!$this->isConfiguredSplashOnly()) {
#$db->execSqlUniqueRes("SELECT COUNT(DISTINCT users.user_id) as count FROM users,connections WHERE connections.token_status='".TOKEN_INUSE."' AND users.user_id=connections.user_id AND connections.node_id='{$this->id}'", $row, false);
#} else {
$db->execSqlUniqueRes("SELECT COUNT(DISTINCT connections.user_mac) as count FROM connections WHERE connections.token_status='".TOKEN_INUSE."' AND connections.node_id='{$this->id}'", $row, false);
#}
return $rowcount?;
}
My personal fix was just to comment out only to include the user_mac query.