summaryrefslogtreecommitdiffstats
path: root/apis
diff options
context:
space:
mode:
authorSimon Rettberg2017-03-31 15:30:46 +0200
committerSimon Rettberg2017-03-31 15:30:46 +0200
commit97f4c881c18962491fafd9a809bf0c1e8b2b0147 (patch)
tree8247cc52b5a9a057d680d492f1d579b66ce26c01 /apis
parent[exams] Extend "upcoming lectures" from 5 to 30 days; collapse list if > 5 (diff)
downloadslx-admin-97f4c881c18962491fafd9a809bf0c1e8b2b0147.tar.gz
slx-admin-97f4c881c18962491fafd9a809bf0c1e8b2b0147.tar.xz
slx-admin-97f4c881c18962491fafd9a809bf0c1e8b2b0147.zip
Remove statistics api file accidentally committed on manual merge
Diffstat (limited to 'apis')
-rw-r--r--apis/statistics.inc.php29
1 files changed, 0 insertions, 29 deletions
diff --git a/apis/statistics.inc.php b/apis/statistics.inc.php
deleted file mode 100644
index 2be805ba..00000000
--- a/apis/statistics.inc.php
+++ /dev/null
@@ -1,29 +0,0 @@
-<?php
-
-$NOW = time();
-$cutoff = $NOW - 86400*90;
-
-$res = Database::simpleQuery("SELECT m.machineuuid, m.locationid, m.macaddr, m.clientip, m.lastseen, m.logintime, m.mbram,"
- . " m.kvmstate, m.cpumodel, m.systemmodel, m.id44mb, m.badsectors, m.hostname, GROUP_CONCAT(s.locationid) AS locs"
- . " FROM machine m"
- . " LEFT JOIN subnet s ON (INET_ATON(m.clientip) BETWEEN s.startaddr AND s.endaddr)"
- . " WHERE m.lastseen > $cutoff"
- . " GROUP BY m.machineuuid");
-
-$return = array(
- 'now' => $NOW,
- 'clients' => array(),
- 'locations' => Location::getLocationsAssoc()
-);
-while ($client = $res->fetch(PDO::FETCH_ASSOC)) {
- if ($NOW - $client['lastseen'] > 610) {
- $client['state'] = 'OFF';
- } elseif ($client['logintime'] == 0) {
- $client['state'] = 'IDLE';
- } else {
- $client['state'] = 'OCCUPIED';
- }
- $return['clients'][] = $client;
-}
-
-die(json_encode($return)); \ No newline at end of file