]> _ Git - cubist_cms-back.git/commitdiff
wip #5700 @0.25
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 27 Jan 2023 14:42:58 +0000 (15:42 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 27 Jan 2023 14:42:58 +0000 (15:42 +0100)
src/app/Magic/Models/ExternalServer.php

index 0a33f07482153e575531b94d57ec369fd310f372..8f58a7f0d6c279a3549d36ce4aedf28e0847711f 100644 (file)
@@ -19,6 +19,8 @@ class ExternalServer extends CubistMagicAbstractModel implements IServer
      */
     public static $_servers = null;
 
+    protected static $_defaultPorts = ['sftp' => 22, 'ftp' => 21, 'ftpes' => 21, 'ftps' => 990];
+
     public function setFields()
     {
         parent::setFields();
@@ -104,7 +106,7 @@ class ExternalServer extends CubistMagicAbstractModel implements IServer
 
     public function getPort()
     {
-        return $this->port;
+        return $this->port ?: self::$_defaultPorts[$this->getProtocol()];
     }
 
     public function getUsername()