From 5bb3c1631232a286dcf2eedb2e383850ed794b40 Mon Sep 17 00:00:00 2001 From: "Florian Aders (EleRas)" Date: Sun, 7 Aug 2011 14:33:37 +0200 Subject: [PATCH] Fixed a few bugs in the WebFTP and allowing optional SSL - connection to the server Signed-off-by: Florian Aders (EleRas) --- templates/Froxlor/webftp/webftp_main_prompt.tpl | 3 +-- webftp.php | 11 ++++++++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/templates/Froxlor/webftp/webftp_main_prompt.tpl b/templates/Froxlor/webftp/webftp_main_prompt.tpl index ddc901b7..4e9b3054 100644 --- a/templates/Froxlor/webftp/webftp_main_prompt.tpl +++ b/templates/Froxlor/webftp/webftp_main_prompt.tpl @@ -19,8 +19,7 @@ font-weight: bold; - - + diff --git a/webftp.php b/webftp.php index 476f353b..d317be9f 100644 --- a/webftp.php +++ b/webftp.php @@ -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);