diff options
author | Simon Rettberg | 2017-04-03 13:58:13 +0200 |
---|---|---|
committer | Simon Rettberg | 2017-04-03 13:58:13 +0200 |
commit | 0b0579fd2fdfd2d1f19e2d6ff51ddc49401da604 (patch) | |
tree | 8538720e5b49fd4e784eabe007f30871a1c0d4fb /modules-available/statistics_reporting | |
parent | [statistics_reporting] Sort by first sortable column by default (diff) | |
download | slx-admin-0b0579fd2fdfd2d1f19e2d6ff51ddc49401da604.tar.gz slx-admin-0b0579fd2fdfd2d1f19e2d6ff51ddc49401da604.tar.xz slx-admin-0b0579fd2fdfd2d1f19e2d6ff51ddc49401da604.zip |
[statistics_reporting] Fallback to ip if client has no hostname
Diffstat (limited to 'modules-available/statistics_reporting')
-rw-r--r-- | modules-available/statistics_reporting/inc/queries.inc.php | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/modules-available/statistics_reporting/inc/queries.inc.php b/modules-available/statistics_reporting/inc/queries.inc.php index bf28a592..f00138ec 100644 --- a/modules-available/statistics_reporting/inc/queries.inc.php +++ b/modules-available/statistics_reporting/inc/queries.inc.php @@ -15,7 +15,7 @@ class Queries GROUP BY machine.machineuuid ) t1 RIGHT JOIN ( - SELECT machine.hostname AS 'name', machine.machineuuid AS 'uuid', SUM(CAST(offlineTable.length AS UNSIGNED)) AS 'offlineSum', MAX(offlineTable.endInBound) AS 'lastStart', IFNULL(location.locationname, '$notassigned') AS 'locName', location.locationid AS 'locId' + SELECT IF(machine.hostname = '', machine.clientip, machine.hostname) AS 'name', machine.machineuuid AS 'uuid', SUM(CAST(offlineTable.length AS UNSIGNED)) AS 'offlineSum', MAX(offlineTable.endInBound) AS 'lastStart', IFNULL(location.locationname, '$notassigned') AS 'locName', location.locationid AS 'locId' FROM ".self::getBoundedTableQueryString('~offline-length', $from, $to, $lowerTimeBound, $upperTimeBound)." offlineTable INNER JOIN machine ON offlineTable.machineuuid = machine.machineuuid LEFT JOIN location ON machine.locationid = location.locationid |