You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$sql = "SELECT $server_type as server_id FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id";
76
100
$client = $app->db->queryOneRecord($sql);
77
-
$sql = "SELECT server_id,server_name FROM server WHERE server_id = ".$client['server_id'];
101
+
if($client['server_id'] > 0) {
102
+
//* Select the default server for the client
103
+
$sql = "SELECT server_id,server_name FROM server WHERE server_id = ".$client['server_id'];
104
+
} else {
105
+
//* Not able to find the clients defaults, use this as fallback and add a warning message to the log
106
+
$app->log('Unable to find default server for client in custom_datasource.inc.php',1);
107
+
$sql = "SELECT server_id,server_name FROM server WHERE $field = 1 ORDER BY server_name";
108
+
}
78
109
} else {
79
-
$sql = "SELECT server_id,server_name FROM server WHERE dns_server = 1 ORDER BY server_name";
110
+
//* The logged in user is admin, so we show him all available servers of a specific type.
111
+
$sql = "SELECT server_id,server_name FROM server WHERE $field = 1 ORDER BY server_name";
0 commit comments