summaryrefslogtreecommitdiffstats
path: root/modules-available
diff options
context:
space:
mode:
authorSimon Rettberg2024-02-07 15:04:52 +0100
committerSimon Rettberg2024-02-07 15:04:52 +0100
commit9e20a3a775c4cb8100b345718af02a9e11109850 (patch)
treef60f0ea9056f7788fbcd5a83d9a6b972a4d7f910 /modules-available
parent[minilinux] Introduce new "installed" state: broken (diff)
downloadslx-admin-9e20a3a775c4cb8100b345718af02a9e11109850.tar.gz
slx-admin-9e20a3a775c4cb8100b345718af02a9e11109850.tar.xz
slx-admin-9e20a3a775c4cb8100b345718af02a9e11109850.zip
Revert "[statistics_reporting] Consider all machines in DB"
Revert these changes that would result in different results. We're still not entirely clear how to handle the case of missing machines vs. machines that just haven't been used for quite some time. So instead of changing this now and possibly again in the near future, leave it as is for now and then do something more clever in the near future. This reverts commit 5dd6473d2f78d74c005ed20fb2a968f9bcae6ade.
Diffstat (limited to 'modules-available')
-rw-r--r--modules-available/statistics_reporting/inc/queries.inc.php9
1 files changed, 3 insertions, 6 deletions
diff --git a/modules-available/statistics_reporting/inc/queries.inc.php b/modules-available/statistics_reporting/inc/queries.inc.php
index 6446a89b..bafe80bc 100644
--- a/modules-available/statistics_reporting/inc/queries.inc.php
+++ b/modules-available/statistics_reporting/inc/queries.inc.php
@@ -15,8 +15,7 @@ class Queries
public static function getClientStatistics(int $from, int $to, int $lowerTimeBound = 0, int $upperTimeBound = 24): array
{
- #$fromCutoff = $from - 86400 * 30;
- $fromCutoff = 0;
+ $fromCutoff = $from - 86400 * 30;
$res = Database::simpleQuery("SELECT m.machineuuid, m.hostname, m.clientip,
m.locationid, m.firstseen -- , m.lastboot, m.logintime, m.state
FROM machine m WHERE firstseen <= $to AND lastseen > $fromCutoff"); // " WHERE lastseen >= :from", compact('from'));
@@ -31,8 +30,7 @@ class Queries
public static function getLocationStatistics(int $from, int $to, int $lowerTimeBound = 0, int $upperTimeBound = 24): array
{
- #$fromCutoff = $from - 86400 * 30;
- $fromCutoff = 0;
+ $fromCutoff = $from - 86400 * 30;
$res = Database::simpleQuery("SELECT m.machineuuid, m.hostname, m.clientip,
m.locationid, m.firstseen -- , m.lastboot, m.logintime, m.state
FROM machine m WHERE firstseen <= $to AND lastseen > $fromCutoff"); // " WHERE lastseen >= :from", compact('from'));
@@ -64,8 +62,7 @@ class Queries
public static function getOverallStatistics(int $from, int $to, $lowerTimeBound = 0, $upperTimeBound = 24)
{
- #$fromCutoff = $from - 86400 * 30;
- $fromCutoff = 0;
+ $fromCutoff = $from - 86400 * 30;
$res = Database::simpleQuery("SELECT m.machineuuid, m.hostname, m.clientip,
m.locationid, m.firstseen -- , m.lastboot, m.logintime, m.state
FROM machine m WHERE firstseen <= $to AND lastseen > $fromCutoff"); // " WHERE lastseen >= :from", compact('from'));