From: soufiane Date: Thu, 25 Jul 2024 14:32:11 +0000 (+0200) Subject: wait #7008 4h X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=f79f6f2a6251455c0018904139664f5773189086;p=fluidbook-toolbox.git wait #7008 4h --- diff --git a/app/Http/Controllers/Admin/Operations/ServerOperation.php b/app/Http/Controllers/Admin/Operations/ServerOperation.php index 50003467c..58d7a0888 100644 --- a/app/Http/Controllers/Admin/Operations/ServerOperation.php +++ b/app/Http/Controllers/Admin/Operations/ServerOperation.php @@ -25,7 +25,10 @@ trait ServerOperation 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); } } diff --git a/app/Models/FluidbookExternalInstallServer.php b/app/Models/FluidbookExternalInstallServer.php index d8b02ed38..3c565cccb 100644 --- a/app/Models/FluidbookExternalInstallServer.php +++ b/app/Models/FluidbookExternalInstallServer.php @@ -28,7 +28,6 @@ class FluidbookExternalInstallServer extends ExternalServer protected static $_permissionBase = 'fluidbook-external-install-server'; - protected $_operations = [ServerOperation::class]; protected static $hostingBasePaths = [ @@ -150,12 +149,14 @@ class FluidbookExternalInstallServer extends ExternalServer '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()) { @@ -175,7 +176,11 @@ class FluidbookExternalInstallServer extends ExternalServer $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; }