summaryrefslogtreecommitdiffstats
path: root/modules-available/locationinfo/api.inc.php
diff options
context:
space:
mode:
authorSimon Rettberg2017-01-20 12:19:27 +0100
committerSimon Rettberg2017-01-20 12:19:27 +0100
commitc2affca145984d46056f91c0f7730275907cca0a (patch)
tree659fb2d1c41199601128044a19b84d3887453f2c /modules-available/locationinfo/api.inc.php
parentDeleted the pcsubtable. Bugs/Usability fixes. (diff)
downloadslx-admin-c2affca145984d46056f91c0f7730275907cca0a.tar.gz
slx-admin-c2affca145984d46056f91c0f7730275907cca0a.tar.xz
slx-admin-c2affca145984d46056f91c0f7730275907cca0a.zip
[locationinfo] Take lastboot into account when calcing pc state
Diffstat (limited to 'modules-available/locationinfo/api.inc.php')
-rw-r--r--modules-available/locationinfo/api.inc.php7
1 files changed, 3 insertions, 4 deletions
diff --git a/modules-available/locationinfo/api.inc.php b/modules-available/locationinfo/api.inc.php
index 60537d5b..ddbd1304 100644
--- a/modules-available/locationinfo/api.inc.php
+++ b/modules-available/locationinfo/api.inc.php
@@ -225,9 +225,9 @@ function getRoomInfoJson($locationID, $coords) {
function getPcInfos($locationID, $coords) {
if ($coords == '1') {
- $dbquery = Database::simpleQuery("SELECT machineuuid, position, logintime, lastseen FROM `machine` WHERE locationid = :locationID" , array('locationID' => $locationID));
+ $dbquery = Database::simpleQuery("SELECT machineuuid, position, logintime, lastseen, lastboot FROM `machine` WHERE locationid = :locationID" , array('locationID' => $locationID));
} else {
- $dbquery = Database::simpleQuery("SELECT machineuuid, logintime, lastseen FROM `machine` WHERE locationid = :locationID" , array('locationID' => $locationID));
+ $dbquery = Database::simpleQuery("SELECT machineuuid, logintime, lastseen, lastboot FROM `machine` WHERE locationid = :locationID" , array('locationID' => $locationID));
}
$pcs = array();
@@ -244,13 +244,12 @@ function getPcInfos($locationID, $coords) {
$computer['y'] = $position['gridRow'];
}
- $computer['pcState'] = LocationInfo::getPcState((int)$pc['logintime'], (int)$pc['lastseen']);
+ $computer['pcState'] = LocationInfo::getPcState($pc);
$pcs[] = $computer;
}
$str = json_encode($pcs, true);
- error_log($str);
return $str;
}