protected function run(Request $request, $id)
{
- $result = FluidbookExternalInstallServer::verifyServerConnexion($request->toArray());
+ $instance = FluidbookExternalInstallServer::find($id);
+ $req = $request->toArray();
+ $req['subdomains'] = $instance->subdomains;
+ $result = FluidbookExternalInstallServer::verifyServerConnexion($req);
return response()->json($result);
}
}
protected static $_permissionBase = 'fluidbook-external-install-server';
-
protected $_operations = [ServerOperation::class];
protected static $hostingBasePaths = [
'password' => $isHosting ? 'nullable' : 'required|string|min:8',
'username' => $isHosting ? 'nullable' : 'required|string|max:255',
'host' => $isHosting ? 'nullable' : 'required|string|max:255',
+ 'subdomains' => 'nullable',
'port' => 'nullable|numeric',
];
$validator = Validator::make([
'password' => $data['password'],
'username' => $data['username'],
'host' => $data['host'],
+ 'subdomains' => $data['subdomains'],
'port' => $data['port']], $validation);
if ($validator->fails()) {
$res['message'] = __("La connexion a été établie avec succès");
} else {
$res['error'] = true;
- $res['message'] = static::messages()[$check];
+ if($isHosting && is_array($check)) {
+ $res['message'] = __("La configuration des sous-domaines suivant est incorrecte : :subdomains", ["subdomains" => $check['subdomains']]);
+ } else {
+ $res['message'] = static::messages()[$check];
+ }
}
return $res;
}