added a very dangerous, very serious vulnerability (constantize
This commit is contained in:
@@ -0,0 +1,17 @@
|
|||||||
|
class BenefitFormsController < ApplicationController
|
||||||
|
|
||||||
|
def index
|
||||||
|
end
|
||||||
|
|
||||||
|
def download
|
||||||
|
begin
|
||||||
|
#file = params[:type].constantize.new(params[:name])
|
||||||
|
file = Rails.root.join('public', 'docs', params[:name])
|
||||||
|
#render :text => File.read(file)
|
||||||
|
send_file file, :disposition => 'attachment'
|
||||||
|
rescue
|
||||||
|
redirect_to user_benefit_forms_path(:user_id => current_user.user_id)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
module BenefitFormsHelper
|
||||||
|
end
|
||||||
@@ -0,0 +1,61 @@
|
|||||||
|
<div class="dashboard-wrapper">
|
||||||
|
<div class="main-container">
|
||||||
|
|
||||||
|
<div class="row-fluid">
|
||||||
|
|
||||||
|
<div class="span4">
|
||||||
|
<div class="widget">
|
||||||
|
<div class="widget-header">
|
||||||
|
<div class="title">
|
||||||
|
<span class="fs1" aria-hidden="true" data-icon=""></span> Health Insurance
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- Begin Widget Body -->
|
||||||
|
<div class="widget-body">
|
||||||
|
<%= link_to download_path(:type => "File", :name => "Health_n_Stuff.pdf") do %>
|
||||||
|
<div class="doc-icons-container">
|
||||||
|
<div class="icon light-blue hidden-tablet">
|
||||||
|
<span class="fs1 doc-icon" aria-hidden="true" data-icon=""></span>
|
||||||
|
<span class="doc-type">
|
||||||
|
PDF
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
<!-- End Widget Body -->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="span4">
|
||||||
|
<div class="widget">
|
||||||
|
<div class="widget-header">
|
||||||
|
<div class="title">
|
||||||
|
<span class="fs1" aria-hidden="true" data-icon=""></span> Dental Insurance
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- Begin Widget Body -->
|
||||||
|
<div class="widget-body">
|
||||||
|
<%= link_to download_path(:type => "File", :name => "Dental_n_Stuff.pdf") do %>
|
||||||
|
<div class="doc-icons-container">
|
||||||
|
<div class="icon light-blue hidden-tablet">
|
||||||
|
<span class="fs1 doc-icon" aria-hidden="true" data-icon=""></span>
|
||||||
|
<span class="doc-type">
|
||||||
|
PDF
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
<!-- End Widget Body -->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
@@ -18,13 +18,13 @@
|
|||||||
<% end %>
|
<% end %>
|
||||||
</li>
|
</li>
|
||||||
<% end %>
|
<% end %>
|
||||||
<li>
|
<li id="benefit_forms">
|
||||||
<a href="#">
|
<%= link_to user_benefit_forms_path(:user_id => current_user.user_id) do %>
|
||||||
<div class="icon">
|
<div class="icon">
|
||||||
<span class="fs1" aria-hidden="true" data-icon=""></span>
|
<span class="fs1" aria-hidden="true" data-icon=""></span>
|
||||||
</div>
|
</div>
|
||||||
Benefit Forms
|
Benefit Forms
|
||||||
</a>
|
<% end %>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<%= link_to user_retirement_index_path(:user_id => current_user.user_id) do %>
|
<%= link_to user_retirement_index_path(:user_id => current_user.user_id) do %>
|
||||||
|
|||||||
@@ -24,8 +24,14 @@ resources :users do
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
resources :benefit_forms do
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
get "download" => "benefit_forms#download"
|
||||||
|
|
||||||
resources :tutorials do
|
resources :tutorials do
|
||||||
collection do
|
collection do
|
||||||
get "injection"
|
get "injection"
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,7 @@
|
|||||||
|
require 'test_helper'
|
||||||
|
|
||||||
|
class BenefitFormsControllerTest < ActionController::TestCase
|
||||||
|
# test "the truth" do
|
||||||
|
# assert true
|
||||||
|
# end
|
||||||
|
end
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
require 'test_helper'
|
||||||
|
|
||||||
|
class BenefitFormsHelperTest < ActionView::TestCase
|
||||||
|
end
|
||||||
Reference in New Issue
Block a user