X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/0465fda75a244123ae35e6ca34f9e1fff4232efa..8ba74c581dff4c66cbe07f94f4283298bb46f22c:/app/controllers/trace_controller.rb diff --git a/app/controllers/trace_controller.rb b/app/controllers/trace_controller.rb index cdfa5e3cb..f206bb99f 100644 --- a/app/controllers/trace_controller.rb +++ b/app/controllers/trace_controller.rb @@ -163,7 +163,9 @@ class TraceController < ApplicationController trace = Trace.find(params[:id]) if trace.visible? and (trace.public? or (@user and @user == trace.user)) - if request.format == Mime::XML + if Acl.address(request.remote_ip).where(:k => "no_trace_download").exists? + render :nothing => true, :status => :forbidden + elsif request.format == Mime::XML send_file(trace.xml_file, :filename => "#{trace.id}.xml", :type => Mime::XML.to_s, :disposition => 'attachment') else send_file(trace.trace_name, :filename => "#{trace.id}#{trace.extension_name}", :type => trace.mime_type, :disposition => 'attachment')