Skip to content
Snippets Groups Projects
Commit 4d622544 authored by Thom's avatar Thom :tools:
Browse files

Server select fix (fixes #4725)

parent ba4577ba
No related branches found
No related tags found
1 merge request!999Server select fix
......@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment