Liran Tal - 2012-06-24

Thanks for the bug report.
Please apply the following patch to library/graphs-reports-online-users.php:

Index: library/graphs-reports-online-users.php

--- library/graphs-reports-online-users.php (revision 2111)
+++ library/graphs-reports-online-users.php (working copy)
@@ -35,16 +35,21 @@
$res = $dbSocket->query($sql);
$totalUsers = $res->numRows();

- $chart->addPoint(new Point("$totalUsers ($totalUsers users total)", "$totalUsers"));

// get total users online
$sql = "SELECT DISTINCT(UserName) FROM ".$configValues['CONFIG_DB_TBL_RADACCT']." WHERE (AcctStopTime is NULL OR AcctStopTime = '0000-00-00 00:00:00')";
$res = $dbSocket->query($sql);
$totalUsersOnline = $res->numRows();
  • if ($totalUsers != 0) {
  • $totalUsersOffline = $totalUsers - $totalUsersOnline;
  • if ($totalUsersOnline == 0) {
  • $chart->addPoint(new Point("$totalUsersOffline ($totalUsersOffline users offline)", "$totalUsersOffline"));
  • } else {
  • $chart->addPoint(new Point("$totalUsersOffline ($totalUsersOffline users offline)", "$totalUsersOffline"));
  • $chart->addPoint(new Point("$totalUsersOnline ($totalUsersOnline users online)", "$totalUsersOnline"));
  • }
  • }

- $chart->addPoint(new Point("$totalUsersOnline ($totalUsersOnline users online)", "$totalUsersOnline"));

$chart->setTitle("Online users");
$chart->render();

Let me know if it works well or requires more attention.