Fixed a few bugs in the WebFTP and allowing optional SSL - connection to the server

Signed-off-by: Florian Aders (EleRas) <eleras@froxlor.org>
This commit is contained in:
Florian Aders (EleRas)
2011-08-07 14:33:37 +02:00
parent df5d3ef66f
commit 5bb3c16312
2 changed files with 11 additions and 3 deletions

View File

@@ -17,6 +17,8 @@
// Configuration
// Server to connect to:
$server = 'localhost';
// Connect to the FTP - server via SSL or not
$useSsl = false;
// Temporary directory on the server (need write permissions)
$downloadDir = "/tmp/";
@@ -193,7 +195,14 @@ elseif ((!empty($_POST['loginname']) && !empty($_POST['password'])) || (!empty($
$_SESSION['password'] = $_POST['password'];
}
$connection = @ftp_connect($_SESSION['server']);
if ($useSsl)
{
$connection = @ftp_ssl_connect($_SESSION['server']);
}
else
{
$connection = @ftp_connect($_SESSION['server']);
}
$loggedOn = @ftp_login($connection, $_SESSION['user'], $_SESSION['password']);
$systype = @ftp_systype($connection);
$pasv = @ftp_pasv($connection, false);