Wiedmann wrote:IMHO RobertSmith is talking about the security script ("\xampp\security\htdocs\security.php") and not about the control panel.
for change the filezilla-process to ServU process.
In the security script he can change the user/password for the test.
Thx for your quick answers. Just to make sure i understand right and I also have one more question.
I didn't succeed to login to FTP @ localhost (yellow with localhost) so i had to use external url. Is this OK?
Here is my code i have added some echo just for my testing.
- Code: Select all
if ($command == "ftp") {
echo "Connect to firewall, ";
// if (($handle = @fsockopen($host, 21, $errno, $errstr, $timeout)) == true) {
if (($handle = @fsockopen("ftp.example.com", 21, $errno, $errstr, $timeout)) == true) {
@fclose($handle);
echo "Open a session to ftp, ";
// $conn_id = ftp_connect("127.0.0.1");
$conn_id = ftp_connect("ftp.example.com"");
// $login_result = @ftp_login($conn_id, "newuser", "wampp");
$login_result = @ftp_login($conn_id, "USER", "PASS");
if (!$conn_id || !$login_result) {
$status = 0;
echo "Ftp-connect failed!";
} else {
echo "Connected";
$status = 1;
ftp_quit($conn_id);
}
} else {
$notrun = 1;
}
}
Result:
UNSECURE: If the FileZilla FTP server was started, the default user 'newuser' with password 'wampp' can upload and change files for your XAMPP webserver. So if you enabled FileZilla FTP you should set a new password for user 'newuser'.
After changing the login back to "original" code.
- Code: Select all
$login_result = @ftp_login($conn_id, "newuser", "wampp");
// $login_result = @ftp_login($conn_id, "USER", "PASS");;
Result:
SECURE: The FileZilla FTP password was changed.
So this is the working code for me (only host is changed)
- Code: Select all
if ($command == "ftp") {
if (($handle = @fsockopen("ftp.example.com", 21, $errno, $errstr, $timeout)) == true) {
@fclose($handle);
$conn_id = ftp_connect("ftp.example.com"");
$login_result = @ftp_login($conn_id, "newuser", "wampp");
if (!$conn_id || !$login_result) {
$status = 0;
} else {
$status = 1;
ftp_quit($conn_id);
}
} else {
$notrun = 1;
}
}
Is there information about this in FAQ or documentation in English or is forum the right place for this type of question?