summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rettberg2017-12-01 12:44:01 +0100
committerSimon Rettberg2017-12-01 12:44:01 +0100
commite02352b47279a6a7bb2a815116e94f71f252d973 (patch)
tree3a0acd113825e193e4ddd5ed7ffe4a07d6db38fb
parent[statistics, roomplanner, locationinfo] Ignore machines with runmode:isclient==0 (diff)
downloadslx-admin-e02352b47279a6a7bb2a815116e94f71f252d973.tar.gz
slx-admin-e02352b47279a6a7bb2a815116e94f71f252d973.tar.xz
slx-admin-e02352b47279a6a7bb2a815116e94f71f252d973.zip
[runmode] Fix client filter logic
-rw-r--r--modules-available/locationinfo/inc/infopanel.inc.php2
-rw-r--r--modules-available/runmode/inc/runmode.inc.php6
2 files changed, 4 insertions, 4 deletions
diff --git a/modules-available/locationinfo/inc/infopanel.inc.php b/modules-available/locationinfo/inc/infopanel.inc.php
index aa4741ee..94f264bb 100644
--- a/modules-available/locationinfo/inc/infopanel.inc.php
+++ b/modules-available/locationinfo/inc/infopanel.inc.php
@@ -86,7 +86,7 @@ class InfoPanel
$ignoreList = array();
if (Module::isAvailable('runmode')) {
// Ignore clients with special runmode not marked as still being a client
- $ignoreList = RunMode::getAllClients(false, true);
+ $ignoreList = RunMode::getAllClients(false, false);
}
$positionCol = $withPosition ? 'm.position,' : '';
diff --git a/modules-available/runmode/inc/runmode.inc.php b/modules-available/runmode/inc/runmode.inc.php
index d5a8479b..d333af58 100644
--- a/modules-available/runmode/inc/runmode.inc.php
+++ b/modules-available/runmode/inc/runmode.inc.php
@@ -181,10 +181,10 @@ class RunMode
/**
* Return assoc array of all configured clients.
* @param bool $withData also return data field?
- * @param bool $clientsOnly only return those with isclient == true
+ * @param bool $isClient true = return clients only, false = return non-clients only, null = return both
* @return array all the entries from the table
*/
- public static function getAllClients($withData = false, $clientsOnly = false)
+ public static function getAllClients($withData = false, $isClient = null)
{
$xtra = '';
if ($withData) {
@@ -193,7 +193,7 @@ class RunMode
$res = Database::simpleQuery("SELECT machineuuid, module, modeid, isclient $xtra FROM runmode");
$ret = array();
while ($row = $res->fetch(PDO::FETCH_ASSOC)) {
- if ($clientsOnly && !$row['isclient'])
+ if (!is_null($isClient) && ($row['isclient'] != 0) !== $isClient)
continue;
$ret[$row['machineuuid']] = $row;
}