Class: ODDB::View::User::Download

Inherits:
HtmlGrid::PassThru
  • Object
show all
Defined in:
src/view/user/download.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) init



12
13
14
15
16
# File 'src/view/user/download.rb', line 12

def init
  if(filename = @session.user_input(:filename))
    @path = File.join('..', 'data', 'downloads', filename)
  end
end

- (Object) to_html(context)



17
18
19
20
21
22
23
24
25
26
27
# File 'src/view/user/download.rb', line 17

def to_html(context)
  line = [
    nil,
    @session.remote_addr,
    @session.user_input(:email),
    @path,
  ].join(';')
  LogFile.append(:download, line, Time.now)
  @session.passthru(@path)
  ''
end