Project

General

Profile

Feature #3848 » openuri-ftp-auth.patch

jlecour (Jérémy Lecour), 09/18/2010 04:02 AM

View differences:

(current document)
# The access sequence is defined by RFC 1738
ftp = Net::FTP.open(self.host)
# todo: extract user/passwd from .netrc.
user = 'anonymous'
passwd = nil
if options.include? :http_basic_authentication
user, passwd = options[:http_basic_authentication]
else
user = 'anonymous'
passwd = nil
end
user, passwd = self.userinfo.split(/:/) if self.userinfo
ftp.login(user, passwd)
directories.each {|cwd|
    (1-1/1)