This commit is contained in:
Nicolas Bally 2016-09-20 22:56:59 +02:00
parent c978bbfc37
commit a76321d035
2 changed files with 1 additions and 4 deletions

View File

@ -5,7 +5,7 @@ class ApplicationController < ActionController::Base
def check_enabled def check_enabled
if !(!@current_customer and current_admin and params[:admin]) or (@current_customer and !@current_customer.account_validated?) if (!@current_customer and current_admin and params[:admin]) or (@current_customer and !@current_customer.account_validated?)
redirect_to public_my_account_path redirect_to public_my_account_path
end end
end end

View File

@ -65,9 +65,6 @@ class Public::DocumentsController < ApplicationController
::POSIX::Spawn::Child.new 'pdftk', "A="+@document.document.file.path, 'B='+@final_file ,"cat", "B1", "A2-end", 'output', @final_file2 ::POSIX::Spawn::Child.new 'pdftk', "A="+@document.document.file.path, 'B='+@final_file ,"cat", "B1", "A2-end", 'output', @final_file2
#pdftk A=/Users/nico/Dev/negos_app/pdf_stamp/contrat.pdf B=/Users/nico/Dev/negos_app/pdf/documents/3.pdf cat B1 A2-end output fichier-final.pdf
@data_to_send = File.open( @final_file2).read @data_to_send = File.open( @final_file2).read
send_data @data_to_send, :filename =>"negos-document-#{@document.id}.pdf" , :type => 'application/pdf',:disposition => (params[:inline] ? 'inline' : "attachment") send_data @data_to_send, :filename =>"negos-document-#{@document.id}.pdf" , :type => 'application/pdf',:disposition => (params[:inline] ? 'inline' : "attachment")