]> _ Git - cubist_cms-back.git/commitdiff
wip #7387 @2
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 13 Mar 2025 16:11:47 +0000 (17:11 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 13 Mar 2025 16:11:47 +0000 (17:11 +0100)
src/app/Magic/Models/ExternalServer.php

index a6d0360b74c0d0a03a82ab546c4550801276a3ea..31bdab24d37d3ebff152df2d2bb3a7d177b51772 100644 (file)
@@ -28,6 +28,7 @@ class ExternalServer extends CubistMagicAbstractModel implements IServer
 
         $this->addField('name', Text::class, __('Nom'), ['column' => true]);
         $this->addField('protocol', SelectFromArray::class, __('Protocole'), ['options' => $this->getProtocols(), 'default' => 'SFTP', 'column' => true, 'allows_null' => false]);
+        $this->addField('ftp_mode', SelectFromArray::class, __('Mode FTP'), ['when' => ['protocol' => $this->getFTPProtocols()], 'options' => ['1' => __('Actif'), '0' => __('Passif')], 'default' => '1']);
         $this->addField('host', Text::class, __('Hôte'), ['default' => '', 'column' => true, 'column_label' => __('Serveur'), 'column_function_name' => 'getServerColumn', 'column_type' => 'model_function', 'when' => ['protocol' => $this->getHostProtocols()]]);
         $this->addField('port', Integer::class, __('Port'), ['hint' => __('Laisser vide pour utiliser le port par défaut'), 'default' => '', 'min' => 1, 'max' => 65536, 'when' => ['protocol' => $this->getPortProtocols()]]);
         $this->addField('username', Text::class, __('Nom d\'utilisateur'), ['when' => ['protocol' => $this->getUsernameProtocols()]]);
@@ -201,7 +202,7 @@ class ExternalServer extends CubistMagicAbstractModel implements IServer
 
     public function getSettings()
     {
-        return ['ftp_mode' => 1];
+        return ['ftp_mode' => $this->ftp_mode];
     }
 
     public function makeURL($path)