summaryrefslogtreecommitdiffstats
path: root/modules-available/statistics_reporting/hooks
diff options
context:
space:
mode:
authorSteffen Ritter2021-11-05 12:41:39 +0100
committerSteffen Ritter2021-11-05 12:41:39 +0100
commitd4b533ffeeed3ce0a4310c3079993e88a42193c7 (patch)
tree3eecd8ffe4af3f9d0ae0c8028b0788fd3fcbd209 /modules-available/statistics_reporting/hooks
parent[dozmod] new resource to request image details (diff)
downloadslx-admin-d4b533ffeeed3ce0a4310c3079993e88a42193c7.tar.gz
slx-admin-d4b533ffeeed3ce0a4310c3079993e88a42193c7.tar.xz
slx-admin-d4b533ffeeed3ce0a4310c3079993e88a42193c7.zip
[statistics_reporting] Always send a minimal report
Even if reporting is disabled send an absolute minimal report which includes at least the satellite version but nothing more. This is just for tracking how many servers are in use.
Diffstat (limited to 'modules-available/statistics_reporting/hooks')
-rw-r--r--modules-available/statistics_reporting/hooks/cron.inc.php30
1 files changed, 14 insertions, 16 deletions
diff --git a/modules-available/statistics_reporting/hooks/cron.inc.php b/modules-available/statistics_reporting/hooks/cron.inc.php
index 14597f7d..7336b7d1 100644
--- a/modules-available/statistics_reporting/hooks/cron.inc.php
+++ b/modules-available/statistics_reporting/hooks/cron.inc.php
@@ -1,25 +1,23 @@
<?php
-if (RemoteReport::isReportingEnabled()) {
- $nextReporting = RemoteReport::getReportingTimestamp();
+$nextReporting = RemoteReport::getReportingTimestamp();
- // It's time to generate a new report
- while ($nextReporting <= time()) {
- RemoteReport::writeNextReportingTimestamp();
+// It's time to generate a new report
+while ($nextReporting <= time()) {
+ RemoteReport::writeNextReportingTimestamp();
- $to = $nextReporting;
+ $to = $nextReporting;
- $statisticsReport = json_encode(RemoteReport::generateReport($to));
+ $statisticsReport = json_encode(RemoteReport::generateReport($to));
- $params = array("action" => "statistics", "data" => $statisticsReport);
+ $params = array("action" => "statistics", "data" => $statisticsReport);
- $result = Download::asStringPost(CONFIG_REPORTING_URL, $params, 30, $code);
+ $result = Download::asStringPost(CONFIG_REPORTING_URL, $params, 30, $code);
- if ($code != 200) {
- EventLog::warning("Statistics Reporting failed: " . $code, $result);
- } else {
- EventLog::info('Statistics report sent to ' . CONFIG_REPORTING_URL);
- }
- $nextReporting = strtotime("+7 days", $nextReporting);
+ if ($code != 200) {
+ EventLog::warning("Statistics Reporting failed: " . $code, $result);
+ } else {
+ EventLog::info('Statistics report sent to ' . CONFIG_REPORTING_URL);
}
-} \ No newline at end of file
+ $nextReporting = strtotime("+7 days", $nextReporting);
+}