summaryrefslogtreecommitdiffstats
path: root/modules-available/runmode
diff options
context:
space:
mode:
authorSimon Rettberg2017-12-01 12:44:01 +0100
committerSimon Rettberg2017-12-01 12:44:01 +0100
commite02352b47279a6a7bb2a815116e94f71f252d973 (patch)
tree3a0acd113825e193e4ddd5ed7ffe4a07d6db38fb /modules-available/runmode
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
Diffstat (limited to 'modules-available/runmode')
-rw-r--r--modules-available/runmode/inc/runmode.inc.php6
1 files changed, 3 insertions, 3 deletions
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;
}