X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/e8c7543bdd5001a69491b8119e793d6c889fe468..6c66507427961a22a8f282b5b2f4ab7fda1dad6f:/app/controllers/trace_controller.rb diff --git a/app/controllers/trace_controller.rb b/app/controllers/trace_controller.rb index dc7456c45..e6c732d2d 100644 --- a/app/controllers/trace_controller.rb +++ b/app/controllers/trace_controller.rb @@ -57,7 +57,12 @@ class TraceController < ApplicationController @tag = params[:tag] files = Tracetag.find_all_by_tag(params[:tag]).collect { |tt| tt.gpx_id } - conditions[0] += " AND gpx_files.id IN (#{files.join(',')})" + + if files.length > 0 + conditions[0] += " AND gpx_files.id IN (#{files.join(',')})" + else + conditions[0] += " AND 0 = 1" + end end conditions[0] += " AND gpx_files.visible = ?" @@ -233,6 +238,7 @@ class TraceController < ApplicationController if trace.inserted? if trace.public? or (@user and @user == trace.user) + 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') else render :nothing => true, :status => :forbidden @@ -249,6 +255,7 @@ class TraceController < ApplicationController if trace.inserted? if trace.public? or (@user and @user == trace.user) + expires_in 7.days, :private => !trace.public, :public => trace.public send_file(trace.icon_picture_name, :filename => "#{trace.id}_icon.gif", :type => 'image/gif', :disposition => 'inline') else render :nothing => true, :status => :forbidden