Skip to content

Commit 4d62254

Browse files
author
Thom Pol
committed
Server select fix (fixes #4725)
1 parent ba4577b commit 4d62254

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

interface/lib/classes/custom_datasource.inc.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,9 +161,10 @@ function client_servers($field, $record) {
161161
$sql = "SELECT $server_type as server_id FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = ?";
162162
$client = $app->db->queryOneRecord($sql, $client_group_id);
163163
if($client['server_id'] > 0) {
164-
//* Select the default server for the client
165-
$sql = "SELECT server_id,server_name FROM server WHERE server_id = ?";
166-
$records = $app->db->queryAllRecords($sql, $client['server_id']);
164+
///* Select the available servers for the client
165+
$clientservers = $client['server_id'];
166+
$sql = "SELECT server_id,server_name FROM server WHERE server_id IN ($clientservers) ORDER BY server_name";
167+
$records = $app->db->queryAllRecords($sql);
167168
} else {
168169
//* Not able to find the clients defaults, use this as fallback and add a warning message to the log
169170
$app->log('Unable to find default server for client in custom_datasource.inc.php', 1);

0 commit comments

Comments
 (0)