diff --git a/rtfm/CONFIG.md b/rtfm/CONFIG.md index 7d95ddf..3c4497e 100644 --- a/rtfm/CONFIG.md +++ b/rtfm/CONFIG.md @@ -61,6 +61,8 @@ This probably requires the php-ftp package but on some platforms it's included i |Option | value type | What it does| |--- | --- | ---| |FTP_SERVER | string | IP or hostname of your FTP Server | +|FTP_PORT | int | Port number of your FTP Server. Defaults to 21 | +|FTP_SSL | bool | If your FTP server supports SSL-FTP (note: not sFTP! not the same), set it to true | |FTP_USER | string | FTP Username | |FTP_PASS | string | FTP Password | |FTP_BASEDIR | string | Base path where files will be stored. Must end with / eg `/web/pictshare/` | diff --git a/storage-controllers/ftp.controller.php b/storage-controllers/ftp.controller.php index 12fe7b7..9875656 100644 --- a/storage-controllers/ftp.controller.php +++ b/storage-controllers/ftp.controller.php @@ -14,8 +14,13 @@ class FTPStorage implements StorageController function connect() { if(!$this->connection) - $this->connection = ftp_connect(FTP_SERVER); - if(!$this->login) + { + if(defined('FTP_SSL') && FTP_SSL === true) + $this->connection = ftp_ssl_connect(FTP_SERVER, ((defined('FTP_SSL') && is_numeric(FTP_PORT))?FTP_PORT:21) ); + else + $this->connection = ftp_connect(FTP_SERVER, ((defined('FTP_SSL') && is_numeric(FTP_PORT))?FTP_PORT:21) ); + } + if($this->connection && !$this->login) { $this->login = ftp_login($this->connection, FTP_USER, FTP_PASS); ftp_pasv($this->connection, TRUE); diff --git a/tools/storagecontroller-sync.php b/tools/storagecontroller-sync.php index 48fca15..13449e7 100644 --- a/tools/storagecontroller-sync.php +++ b/tools/storagecontroller-sync.php @@ -23,6 +23,7 @@ foreach($sc as $contr) if((new $contr())->isEnabled()===true) { $controllers[] = new $contr(); + echo "[i] Found storage controller ".get_class($controllers[(count($controllers)-1)])."\n"; } }