diff options
Diffstat (limited to 'modules-available/locationinfo/inc/locationinfo.inc.php')
-rw-r--r-- | modules-available/locationinfo/inc/locationinfo.inc.php | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/modules-available/locationinfo/inc/locationinfo.inc.php b/modules-available/locationinfo/inc/locationinfo.inc.php index f81d79f6..d4bd2b0a 100644 --- a/modules-available/locationinfo/inc/locationinfo.inc.php +++ b/modules-available/locationinfo/inc/locationinfo.inc.php @@ -3,7 +3,7 @@ class LocationInfo { - public static function getPcState($logintime, $lastseen) + public static function getPcState($pc) { /* pcState: * [0] = IDLE (NOT IN USE) @@ -12,13 +12,16 @@ class LocationInfo * [3] = 10 days offline (BROKEN?) */ + $logintime = (int)$pc['logintime']; + $lastseen = (int)$pc['lastseen']; + $lastboot = (int)$pc['lastboot']; $NOW = time(); - if ($NOW - $lastseen > 864000) { + if ($NOW - $lastseen > 14*86400) { return 3; - } elseif ($NOW - $lastseen > 610) { + } elseif (($NOW - $lastseen > 610) || $lastboot === 0) { return 2; - } elseif ($logintime == 0) { + } elseif ($logintime === 0) { return 0; } elseif ($logintime > 0) { return 1; |