Method: Firewool::InstanceMethods#ip_filter

Defined in:
lib/firewool/instance_methods.rb

#ip_filterObject

TODO: opinionated. provide instructions on how to forget about this filter and redirect to their own thing. but this should redirect to the 403.html in public



5
6
7
8
9
10
11
12
13
14
# File 'lib/firewool/instance_methods.rb', line 5

def ip_filter
  # if no allowed ranges match, then deny
  if !ip_allow?(request.remote_ip)
    if File.exists? "#{::Rails.root.to_s}/public/403.html"
      render :file => "#{::Rails.root.to_s}/public/403.html", :layout => false, :status => 403
    else
      render :text => "Public Access Denied.", :status => 403
    end
  end
end