diff options
author | Simon Rettberg | 2016-09-13 15:40:27 +0200 |
---|---|---|
committer | Simon Rettberg | 2016-09-13 15:40:27 +0200 |
commit | 93144b641bfd186d0c27d82757ca203990dab30f (patch) | |
tree | c12ec372e2a8a2026a3b9c4872f027d8670f4c70 /modules-available/locations | |
parent | skip rooms without manager ip because that trips pvsmgr. (diff) | |
download | slx-admin-93144b641bfd186d0c27d82757ca203990dab30f.tar.gz slx-admin-93144b641bfd186d0c27d82757ca203990dab30f.tar.xz slx-admin-93144b641bfd186d0c27d82757ca203990dab30f.zip |
[statistics/locations] Fix query for getting machines for a location
Diffstat (limited to 'modules-available/locations')
-rw-r--r-- | modules-available/locations/page.inc.php | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/modules-available/locations/page.inc.php b/modules-available/locations/page.inc.php index 5f3c87dd..1bf33dda 100644 --- a/modules-available/locations/page.inc.php +++ b/modules-available/locations/page.inc.php @@ -438,8 +438,8 @@ class Page_Locations extends Page $count = $online = $used = 0; if (Module::get('statistics') !== false) { $mres = Database::simpleQuery("SELECT lastseen, logintime FROM machine" - . " INNER JOIN subnet ON (INET_ATON(machine.clientip) BETWEEN startaddr AND endaddr)" - . " WHERE (subnet.locationid = :lid AND machine.locationid IS NULL) OR machine.locationid = :lid", array('lid' => $locationId)); + . " LEFT JOIN subnet ON (INET_ATON(machine.clientip) BETWEEN startaddr AND endaddr AND machine.locationid IS NULL)" + . " WHERE (subnet.locationid = :lid) OR (machine.locationid = :lid)", array('lid' => $locationId)); $DL = time() - 605; while ($row = $mres->fetch(PDO::FETCH_ASSOC)) { $count++; |