added new setting: backup ftp passive mode, fixes #785

Signed-off-by: Christoph Burchert (Chb) <derchb@froxlor.org>
This commit is contained in:
Christoph Burchert (Chb)
2011-05-18 02:08:45 +02:00
parent 75c5fae6b2
commit 7a4501e581
6 changed files with 27 additions and 2 deletions

View File

@@ -122,7 +122,17 @@ if($settings['system']['backup_enabled'] == '1'){
if(preg_match('/.*\.tar\.gz$/', $ftp_file)){
$ftp_con = ftp_connect($settings['system']['backup_ftp_server']);
$ftp_login = ftp_login($ftp_con, $settings['system']['backup_ftp_user'], $settings['system']['backup_ftp_pass']);
ftp_pasv($ftp_con, true);
/* Check whether to use passive mode or not */
if($settings['system']['backup_ftp_passive'] == 1)
{
ftp_pasv($ftp_con, true);
}
else
{
ftp_pasv($ftp_con, false);
}
$ftp_upload = ftp_put($ftp_con, $ftp_file, $row['documentroot'] . $settings['system']['backup_dir'] . "/" . $ftp_file, FTP_BINARY);
}
}