8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
# File 'lib/oddb/html/view/download.rb', line 8
def to_html(context)
if download_file = @session.user_input(:file) and email = @session.user_input(:email)
time = Time.now
log_dir = File.join(ODDB.config.download_log_dir, time.year.to_s)
FileUtils.mkdir_p log_dir
log_file = File.join(log_dir, time.month.to_s + '.log')
Logger.new(log_file).info do
[
time.strftime('%Y-%m-%d %H:%M:%S %Z'),
@session.remote_addr,
email,
File.join(ODDB.config.export_dir, download_file)
].join(';')
end
end
@session.passthru(@model)
''
end
|