1
0
Fork 0
Dieser Commit ist enthalten in:
DSB 2012-07-23 08:54:07 +00:00
Ursprung eebf048a4b
Commit 78afe70561

Datei anzeigen

@ -313,7 +313,7 @@ class ConfigController extends Zend_Controller_Action
// Params for transferring a test file
$name = 'ftp_transfer_testfile.txt';
$filename = APPLICATION_PATH . '/forms/Config/ftp_transfertest/ftp_transfer_testfile.txt';
$target_folder = APPLICATION_PATH . '/forms/Config/ftp_transfertest/ftp_target/';
$targetFolder = APPLICATION_PATH . '/forms/Config/ftp_transfertest/ftp_target/';
$upload = false;
// try to connect via ssl to the ftp server
@ -341,11 +341,11 @@ class ConfigController extends Zend_Controller_Action
} else if (!ftp_chdir($ftpStream, $directory)) {
$message = sprintf($translator->_('L_CHANGEDIRERROR'));
// chmod target_folder if it's necessary
} else if (file_exists($target_folder) && substr(sprintf('%o', fileperms($target_folder)), -4) < '0755') {
ftp_chmod($ftpStream, 0755, $target_folder);
} else if (file_exists($targetFolder) && substr(sprintf('%o', fileperms($targetFolder)), -4) < '0755') {
ftp_chmod($ftpStream, 0755, $targetFolder);
$message = '';
// ftp directory exists and chmod ok? let's test the ftp transfer with a test file
} else if (!ftp_put($ftpStream, $target_folder.$name, $filename, FTP_ASCII)) {
} else if (!ftp_put($ftpStream, $targetFolder.$name, $filename, FTP_ASCII)) {
$message = sprintf($translator->_('L_FTP_FILE_TRANSFER_ERROR'), $name);
} else {
@ -355,8 +355,8 @@ class ConfigController extends Zend_Controller_Action
$translator->_('L_FTP_OK');
// delete the test file after a successful transfer test
if (file_exists($target_folder.$name)) {
ftp_delete($ftpStream, $target_folder.$name);
if (file_exists($targetFolder.$name)) {
ftp_delete($ftpStream, $targetFolder.$name);
}
}