summaryrefslogtreecommitdiffstats
path: root/modules-available/roomplanner
diff options
context:
space:
mode:
authorSimon Rettberg2017-12-01 12:49:03 +0100
committerSimon Rettberg2017-12-01 12:49:03 +0100
commit257ceda843712fb0c30c1a4842305dedee903b79 (patch)
tree7e057544a2092eec7f174a2eba138cf058edb938 /modules-available/roomplanner
parent[runmode] Fix client filter logic (diff)
downloadslx-admin-257ceda843712fb0c30c1a4842305dedee903b79.tar.gz
slx-admin-257ceda843712fb0c30c1a4842305dedee903b79.tar.xz
slx-admin-257ceda843712fb0c30c1a4842305dedee903b79.zip
[roomplanner] Fallback to ip if hostname is empty
Diffstat (limited to 'modules-available/roomplanner')
-rw-r--r--modules-available/roomplanner/page.inc.php6
1 files changed, 6 insertions, 0 deletions
diff --git a/modules-available/roomplanner/page.inc.php b/modules-available/roomplanner/page.inc.php
index 71499caf..b44d945d 100644
--- a/modules-available/roomplanner/page.inc.php
+++ b/modules-available/roomplanner/page.inc.php
@@ -111,6 +111,9 @@ class Page_Roomplanner extends Page
$returnObject = ['machines' => []];
while ($row = $result->fetch(PDO::FETCH_ASSOC)) {
+ if (empty($row['hostname'])) {
+ $row['hostname'] = $row['clientip'];
+ }
$returnObject['machines'][] = $row;
}
echo json_encode($returnObject);
@@ -294,6 +297,9 @@ class Page_Roomplanner extends Page
$machines = [];
while ($row = $result->fetch(PDO::FETCH_ASSOC)) {
+ if (empty($row['hostname'])) {
+ $row['hostname'] = $row['clientip'];
+ }
$machines[] = $row;
}