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/statistics | |
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/statistics')
-rw-r--r-- | modules-available/statistics/inc/filter.inc.php | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/modules-available/statistics/inc/filter.inc.php b/modules-available/statistics/inc/filter.inc.php index b35075bc..03dba6c3 100644 --- a/modules-available/statistics/inc/filter.inc.php +++ b/modules-available/statistics/inc/filter.inc.php @@ -217,10 +217,10 @@ class LocationFilter extends Filter $joins[] = 'LEFT JOIN subnet s ON (INET_ATON(machine.clientip) BETWEEN s.startaddr AND s.endaddr)'; return 'machine.locationid IS NULL AND s.locationid IS NULL'; } else { - $joins[] = ' INNER JOIN subnet ON (INET_ATON(clientip) BETWEEN startaddr AND endaddr) '; + $joins[] = ' LEFT JOIN subnet ON (INET_ATON(clientip) BETWEEN startaddr AND endaddr AND machine.locationid IS NULL) '; $args['lid'] = $this->argument; $neg = $this->operator == '=' ? '' : 'NOT'; - return "$neg ((subnet.locationid = :lid AND machine.locationid IS NULL) OR machine.locationid = :lid)"; + return "$neg ((subnet.locationid = :lid) OR (machine.locationid = :lid))"; } } } |