From 5c23e7d7e1c9ade9755c530c9320ad7e5b463413 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Fri, 1 Dec 2017 12:30:23 +0100 Subject: [statistics, roomplanner, locationinfo] Ignore machines with runmode:isclient==0 --- modules-available/locationinfo/inc/infopanel.inc.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'modules-available/locationinfo/inc/infopanel.inc.php') diff --git a/modules-available/locationinfo/inc/infopanel.inc.php b/modules-available/locationinfo/inc/infopanel.inc.php index dacf860f..aa4741ee 100644 --- a/modules-available/locationinfo/inc/infopanel.inc.php +++ b/modules-available/locationinfo/inc/infopanel.inc.php @@ -83,6 +83,12 @@ class InfoPanel $idList = array_keys($array); } + $ignoreList = array(); + if (Module::isAvailable('runmode')) { + // Ignore clients with special runmode not marked as still being a client + $ignoreList = RunMode::getAllClients(false, true); + } + $positionCol = $withPosition ? 'm.position,' : ''; $query = "SELECT m.locationid, m.machineuuid, $positionCol m.logintime, m.lastseen, m.lastboot, m.state FROM machine m WHERE m.locationid IN (:idlist)"; @@ -90,6 +96,8 @@ class InfoPanel // Iterate over matching machines while ($row = $dbquery->fetch(PDO::FETCH_ASSOC)) { + if (isset($ignoreList[$row['machineuuid']])) + continue; settype($row['locationid'], 'int'); if (!isset($array[$row['locationid']])) { $array[$row['locationid']] = array('id' => $row['locationid'], 'machines' => array()); @@ -219,4 +227,4 @@ class InfoPanel return $result; } -} \ No newline at end of file +} -- cgit v1.2.3-55-g7522