From 4d622544edd4572532b2ac42a311f8ede01b722c Mon Sep 17 00:00:00 2001 From: Thom Pol <thom@amsterdamtech.nl> Date: Tue, 26 May 2020 17:22:23 +0200 Subject: [PATCH] Server select fix (fixes #4725) --- interface/lib/classes/custom_datasource.inc.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/interface/lib/classes/custom_datasource.inc.php b/interface/lib/classes/custom_datasource.inc.php index c50d585027..57078388f0 100644 --- a/interface/lib/classes/custom_datasource.inc.php +++ b/interface/lib/classes/custom_datasource.inc.php @@ -161,9 +161,10 @@ class custom_datasource { $sql = "SELECT $server_type as server_id FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = ?"; $client = $app->db->queryOneRecord($sql, $client_group_id); if($client['server_id'] > 0) { - //* Select the default server for the client - $sql = "SELECT server_id,server_name FROM server WHERE server_id = ?"; - $records = $app->db->queryAllRecords($sql, $client['server_id']); + ///* Select the available servers for the client + $clientservers = $client['server_id']; + $sql = "SELECT server_id,server_name FROM server WHERE server_id IN ($clientservers) ORDER BY server_name"; + $records = $app->db->queryAllRecords($sql); } else { //* Not able to find the clients defaults, use this as fallback and add a warning message to the log $app->log('Unable to find default server for client in custom_datasource.inc.php', 1); -- GitLab