Class: ODDB::View::User::SponsorLink

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

Instance Method Summary (collapse)

Instance Method Details

- (Object) http_headers



16
17
18
19
20
# File 'src/view/user/sponsorlink.rb', line 16

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


8
9
10
11
12
13
14
15
# File 'src/view/user/sponsorlink.rb', line 8

def sponsorlink
  sl = @model.url(@session.language)
  if(sl.nil? || /https?:\/\//u.match(sl))
    sl
  else
    "http://" + sl
  end
end

- (Object) to_html(context)



21
22
23
24
25
26
27
28
29
30
# File 'src/view/user/sponsorlink.rb', line 21

def to_html(context)
  line = [
    nil,
    sponsorlink,
    @session.remote_addr,
    nil,
  ].join(';')
  LogFile.append("sponsor_#{@session.flavor}", line, Time.now)
  super
end