From e02352b47279a6a7bb2a815116e94f71f252d973 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Fri, 1 Dec 2017 12:44:01 +0100 Subject: [runmode] Fix client filter logic --- modules-available/runmode/inc/runmode.inc.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'modules-available/runmode') 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; } -- cgit v1.2.3-55-g7522