From: Vincent Vanwaelscappel Date: Fri, 27 Jan 2023 14:42:58 +0000 (+0100) Subject: wip #5700 @0.25 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=c7f841ce9296f9f9c497c49199280096baa787a2;p=cubist_cms-back.git wip #5700 @0.25 --- diff --git a/src/app/Magic/Models/ExternalServer.php b/src/app/Magic/Models/ExternalServer.php index 0a33f07..8f58a7f 100644 --- a/src/app/Magic/Models/ExternalServer.php +++ b/src/app/Magic/Models/ExternalServer.php @@ -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()