diff options
author | Jannik Schönartz | 2017-03-27 01:15:48 +0200 |
---|---|---|
committer | Jannik Schönartz | 2017-03-27 01:15:48 +0200 |
commit | f39de488a48b091c047ec862e2e850b678d487de (patch) | |
tree | f65453e6978dc43d2b512814dc9122cd35376eff /modules-available | |
parent | Bugfixes: serversettings option 1 is selected when switching backend type. So... (diff) | |
download | slx-admin-f39de488a48b091c047ec862e2e850b678d487de.tar.gz slx-admin-f39de488a48b091c047ec862e2e850b678d487de.tar.xz slx-admin-f39de488a48b091c047ec862e2e850b678d487de.zip |
Changed pc states 0 = IDLE, 1 = OCCUPIED, 2 = OFF, 3 = BROKEN
Diffstat (limited to 'modules-available')
-rw-r--r-- | modules-available/locationinfo/api.inc.php | 8 | ||||
-rw-r--r-- | modules-available/locationinfo/inc/locationinfo.inc.php | 8 |
2 files changed, 8 insertions, 8 deletions
diff --git a/modules-available/locationinfo/api.inc.php b/modules-available/locationinfo/api.inc.php index c5bbf76c..319dc3a5 100644 --- a/modules-available/locationinfo/api.inc.php +++ b/modules-available/locationinfo/api.inc.php @@ -332,13 +332,13 @@ function getPcStates($idList) $broken = 0; foreach ($roomInfo['computer'] as $computer) { - if ($computer['pcState'] == 0) { + if ($computer['pcState'] == "IDLE") { $idle++; - } elseif ($computer['pcState'] == 1) { + } elseif ($computer['pcState'] == "OCCUPIED") { $occupied++; - } elseif ($computer['pcState'] == 2) { + } elseif ($computer['pcState'] == "OFF") { $off++; - } elseif ($computer['pcState'] == 3) { + } elseif ($computer['pcState'] == "BROKEN") { $broken++; } } diff --git a/modules-available/locationinfo/inc/locationinfo.inc.php b/modules-available/locationinfo/inc/locationinfo.inc.php index 4e2ea8aa..f924e469 100644 --- a/modules-available/locationinfo/inc/locationinfo.inc.php +++ b/modules-available/locationinfo/inc/locationinfo.inc.php @@ -25,13 +25,13 @@ class LocationInfo $NOW = time(); if ($NOW - $lastseen > 14 * 86400) { - return 3; + return "BROKEN"; } elseif (($NOW - $lastseen > 610) || $lastboot === 0) { - return 2; + return "OFF"; } elseif ($logintime === 0) { - return 0; + return "IDLE"; } elseif ($logintime > 0) { - return 1; + return "OCCUPIED"; } return -1; } |