Class: ODDB::View::User::PassThru

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

Instance Method Summary (collapse)

Instance Method Details

- (Object) http_headers



19
20
21
22
23
# File 'src/view/user/passthru.rb', line 19

def http_headers
  {
    "Location" =>  passthru,
  }
end

- (Object) passthru



11
12
13
14
15
16
17
18
# File 'src/view/user/passthru.rb', line 11

def passthru
  href = @session.user_input(:destination)
  if(href.nil? || /https?:\/\//u.match(href))
    href
  else
    "http://" + href
  end
end

- (Object) to_html(context)



24
25
26
27
28
29
30
31
32
# File 'src/view/user/passthru.rb', line 24

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