X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/db1cda3e05ed090d0fcb5ff6ffdb66b0448551f8..ec5754a9bd56dbb802a2897851ebf71deb017f89:/app/controllers/traces/pictures_controller.rb diff --git a/app/controllers/traces/pictures_controller.rb b/app/controllers/traces/pictures_controller.rb index 0e0d588cb..0b26ed884 100644 --- a/app/controllers/traces/pictures_controller.rb +++ b/app/controllers/traces/pictures_controller.rb @@ -6,21 +6,12 @@ module Traces authorize_resource :trace def show - trace = Trace.visible.find(params[:trace_id]) + trace = Trace.visible.imported.find(params[:trace_id]) - if trace.inserted? - if trace.public? || (current_user && current_user == trace.user) - if trace.icon.attached? - redirect_to rails_blob_path(trace.image, :disposition => "inline") - else - expires_in 7.days, :private => !trace.public?, :public => trace.public? - send_file(trace.large_picture_name, :filename => "#{trace.id}.gif", :type => "image/gif", :disposition => "inline") - end - else - head :forbidden - end + if trace.public? || (current_user && current_user == trace.user) + redirect_to rails_blob_path(trace.image, :disposition => "inline") else - head :not_found + head :forbidden end rescue ActiveRecord::RecordNotFound head :not_found