From 315c35badf1e1f3b20424bdb084133beb00aeee4 Mon Sep 17 00:00:00 2001 From: Jannik Schönartz Date: Tue, 6 Dec 2016 09:06:22 -0800 Subject: Locationinfo: Fixed a bug where the api was sending the json with wrong information. Disabled pcState 2/3 because it's not working in the test environment because lastseen does not refresh. --- modules-available/locationinfo/api.inc.php | 2 +- modules-available/locationinfo/inc/locationinfo.inc.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules-available/locationinfo/api.inc.php b/modules-available/locationinfo/api.inc.php index 2642ec78..c0b5c2fc 100644 --- a/modules-available/locationinfo/api.inc.php +++ b/modules-available/locationinfo/api.inc.php @@ -189,7 +189,7 @@ function getPcInfos($locationID, $coords) { $computer['y'] = $position['gridRow']; } - $computer['pcState'] = LocationInfo::getPcState((int)$computer['logintime'], (int)$computer['lastseen']); + $computer['pcState'] = LocationInfo::getPcState((int)$pc['logintime'], (int)$pc['lastseen']); $pcs[] = $computer; } diff --git a/modules-available/locationinfo/inc/locationinfo.inc.php b/modules-available/locationinfo/inc/locationinfo.inc.php index 4f26519d..a93658b0 100644 --- a/modules-available/locationinfo/inc/locationinfo.inc.php +++ b/modules-available/locationinfo/inc/locationinfo.inc.php @@ -14,9 +14,9 @@ class LocationInfo $NOW = time(); - if ($NOW - $lastseen > 864000) { + if ($NOW - $lastseen > 864000 && false) { // TODO: REMOVE FALSE. TEST in testenvironment is not possible return 3; - } elseif ($NOW - $lastseen > 610) { + } elseif ($NOW - $lastseen > 610 && false) { // TODO: REMOVE FALSE. TEST in testenvironment is not possible return 2; } elseif ($logintime == 0) { return 0; -- cgit v1.2.3-55-g7522