// try to default with session id and passwd if (!($connInfo = getConnectionInfo())) { $connInfo['username'] = $default_login; $connInfo['password'] = $default_pass; $connInfo['ftpserver'] = $default_server; $tried_default = true; } } updateSession($connInfo); $sessionUpdated = true; } if ($action != 'newlogin') { if (!count($connInfo)) { $connInfo = getConnectionInfo(); } $ftp = @phpftp_connect($connInfo['ftpserver'], $connInfo['username'], $connInfo['password']); if ($ftp) { $homedir = ftp_pwd($ftp); $retval = ftp_pasv($ftp, 1); if ($action == 'delete' || $action == 'rmdir') { if ($_POST['confirm']) { if ($action == 'delete') { $retval = @ftp_delete($ftp, $olddir . '/' . $file); } else { $retval = @ftp_rmdir($ftp, $olddir . '/' . $file); } if ($retval) { $GLOBALS['phpgw']->template->set_var("misc_data", lang('Successfully deleted %1', "{$olddir}/{$file}"), true); } else { $GLOBALS['phpgw']->template->set_var('misc_data', lang('failed to delete %1', "{$olddir}/{$file}"), true); }
function phpftp_get($phpftp_user,$phpftp_passwd,$phpftp_dir,$select_file) { global $phpftp_host; $ftp = @phpftp_connect($phpftp_user,$phpftp_passwd); if (!$ftp) { // FTP Login failed! } else { ftp_quit($ftp); } }