From: soufiane Date: Thu, 23 Nov 2023 09:50:20 +0000 (+0100) Subject: wait #6477 @0:20 ajout du fingerprint X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=99209367ab558298988d8a7a87414306cd58b177;p=fluidbook-toolbox.git wait #6477 @0:20 ajout du fingerprint --- diff --git a/app/Http/Controllers/Admin/Operations/ServerOperation.php b/app/Http/Controllers/Admin/Operations/ServerOperation.php index 34bc6ece6..ac764bf68 100644 --- a/app/Http/Controllers/Admin/Operations/ServerOperation.php +++ b/app/Http/Controllers/Admin/Operations/ServerOperation.php @@ -3,6 +3,7 @@ namespace App\Http\Controllers\Admin\Operations; use App\Models\FluidbookExternalInstallServer; +use App\Models\FluidbookPublication; use Illuminate\Http\Request; use Illuminate\Support\Facades\Route; use Illuminate\Support\Facades\Validator; diff --git a/app/Models/FluidbookExternalInstallServer.php b/app/Models/FluidbookExternalInstallServer.php index f395fc606..3427de5c0 100644 --- a/app/Models/FluidbookExternalInstallServer.php +++ b/app/Models/FluidbookExternalInstallServer.php @@ -10,6 +10,7 @@ use Cubist\Backpack\Magic\Models\ExternalServer; use Cubist\Net\Transfer\Local; use Cubist\Util\Files\Files; use Cubist\Util\Json; +use Illuminate\Support\Facades\DB; // __('!! Serveurs externes') class FluidbookExternalInstallServer extends ExternalServer @@ -35,6 +36,7 @@ class FluidbookExternalInstallServer extends ExternalServer parent::setFields(); $this->addField('redirections', Table::class, __('Redirections'), ['entity_singular' => __('redirection'), 'columns' => ['from' => __('De'), 'to' => __('Vers')], 'when' => ['protocol' => 'hosting']]); $this->addField('allows_root', Checkbox::class, __('Autoriser le chargement à la racine (sur le chemin de base)'), ['default' => false]); + } public function onSaved(): bool @@ -106,6 +108,17 @@ class FluidbookExternalInstallServer extends ExternalServer } catch (\Exception $e) { } + try { + $fingerprint = ssh2_fingerprint($connection, + SSH2_FINGERPRINT_MD5 | SSH2_FINGERPRINT_HEX); + } catch (\Exception $e) { + + } + + if(!$fingerprint) { + throw new \Exception('Fingerprint missing'); + } + try { self::$isValidConnexion = ssh2_auth_password($connection, $usr, $pwd); } catch (\Exception $e) { @@ -120,4 +133,16 @@ class FluidbookExternalInstallServer extends ExternalServer return self::$isValidConnexion; } + + public static function listFluidbook() + { + /*return DB::table('fluidbook_external_install_server') + ->join('fluidbook_publication', 'fluidbook_external_install_server.name', '=', 'fluidbook_publication.c_title') + ->where('fluidbook_external_install_server.created_ok','1') + ->where('fluidbook_external_install_server.host','!=','') + ->select() + ->get() + ->groupBy('fluidbook_external_install_server.host') + ->toArray();*/ + } } diff --git a/resources/views/vendor/backpack/crud/edit-external-server.blade.php b/resources/views/vendor/backpack/crud/edit-external-server.blade.php index b62239e7a..cd8afa1d8 100644 --- a/resources/views/vendor/backpack/crud/edit-external-server.blade.php +++ b/resources/views/vendor/backpack/crud/edit-external-server.blade.php @@ -10,8 +10,6 @@ window.location.href = $(this).attr('href') + document.location.hash; }); - console.log('{{$entry->id}}') - //$("#saveActions").prepend("") $("#saveActions").prepend("Tester la connexion") @@ -59,3 +57,4 @@ @include('cubist_back::when') @include('crud::edit') +