mirror of
https://github.com/HaschekSolutions/pictshare.git
synced 2025-11-11 10:46:22 +00:00
added setting and possible fix for passive mode. fixes #135 probably
This commit is contained in:
@@ -45,6 +45,7 @@ _buildConfig() {
|
||||
echo "define('FTP_PORT', ${FTP_PORT:-21});"
|
||||
echo "define('FTP_USER', '${FTP_USER:-}');"
|
||||
echo "define('FTP_PASS', '${FTP_PASS:-}');"
|
||||
echo "define('FTP_PASSIVEMODE', ${FTP_PASSIVEMODE:-true});"
|
||||
echo "define('FTP_SSL', ${FTP_SSL:-false});"
|
||||
echo "define('FTP_BASEDIR', '${FTP_BASEDIR:-}');"
|
||||
echo "define('ENCRYPTION_KEY', '${ENCRYPTION_KEY:-}');"
|
||||
|
||||
@@ -81,3 +81,4 @@ This probably requires the php-ftp package but on some platforms it's included i
|
||||
|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/` |
|
||||
|FTP_PASSIVEMODE | bool | Wether to use passive mode or not. If you have troubles with uploading, switch this setting maybe |
|
||||
|
||||
@@ -23,7 +23,15 @@ class FTPStorage implements StorageController
|
||||
if($this->connection && !$this->login)
|
||||
{
|
||||
$this->login = ftp_login($this->connection, FTP_USER, FTP_PASS);
|
||||
ftp_pasv($this->connection, TRUE);
|
||||
|
||||
if( (defined('FTP_PASSIVEMODE') && FTP_PASSIVEMODE === true) || !defined('FTP_PASSIVEMODE') )
|
||||
{
|
||||
ftp_set_option($this->connection, FTP_USEPASVADDRESS, false);
|
||||
ftp_pasv($this->connection, TRUE);
|
||||
}
|
||||
else
|
||||
ftp_pasv($this->connection, false);
|
||||
|
||||
}
|
||||
|
||||
// Was the connection successful?
|
||||
|
||||
Reference in New Issue
Block a user