From c7f841ce9296f9f9c497c49199280096baa787a2 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Fri, 27 Jan 2023 15:42:58 +0100 Subject: [PATCH] wip #5700 @0.25 --- src/app/Magic/Models/ExternalServer.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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() -- 2.39.5