bug in client limits
A reseller should be able to set multiple servers to his clients.
At the moment this it not possible, only one server shows in the client limit edit.
Tested in a clean multi-server dev environment.
What I think is the cause is that a reseller is not an admin in "./lib/classes/custom_datasource.inc.php"
if($_SESSION["s"]["user"]["typ"] == 'user') {
// Get the limits of the client
$client_group_id = $app->functions->intval($_SESSION["s"]["user"]["default_group"]);
$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']);
} 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);
$sql = "SELECT server_id,server_name FROM server WHERE ?? = 1 AND mirror_server_id = 0 ORDER BY server_name";
$records = $app->db->queryAllRecords($sql, $field);
}
} else {
//* The logged in user is admin, so we show him all available servers of a specific type.
$sql = "SELECT server_id,server_name FROM server WHERE ?? = 1 AND mirror_server_id = 0 ORDER BY server_name";
$records = $app->db->queryAllRecords($sql, $field);
}