Skip to content

Commit 2fa5ed2

Browse files
author
Till Brehm
committed
Merge branch 'server-select-fix' into 'stable-3.1'
Server select fix See merge request ispconfig/ispconfig3!999
2 parents bfc5f33 + 9e1fe1b commit 2fa5ed2

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 = explode(',',$client['server_id']);
166+
$sql = "SELECT server_id,server_name FROM server WHERE server_id IN ? ORDER BY server_name";
167+
$records = $app->db->queryAllRecords($sql,$clientservers);
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)