skip_before_filter :verify_authenticity_token, :only => [:api_create, :api_read, :api_update, :api_delete, :api_data]
before_filter :authorize_web
skip_before_filter :verify_authenticity_token, :only => [:api_create, :api_read, :api_update, :api_delete, :api_data]
before_filter :authorize_web
- flash[:error] = t 'trace.view.trace_not_found'
- redirect_to :controller => 'trace', :action => 'list'
+ flash[:error] = t "trace.view.trace_not_found"
+ redirect_to :controller => "trace", :action => "list"
- flash[:error] = t 'trace.view.trace_not_found'
- redirect_to :controller => 'trace', :action => 'list'
+ flash[:error] = t "trace.view.trace_not_found"
+ redirect_to :controller => "trace", :action => "list"
if Acl.no_trace_download(request.remote_ip)
render :text => "", :status => :forbidden
elsif request.format == Mime::XML
if Acl.no_trace_download(request.remote_ip)
render :text => "", :status => :forbidden
elsif request.format == Mime::XML
- send_file(trace.xml_file, :filename => "#{trace.id}.xml", :type => request.format.to_s, :disposition => 'attachment')
+ send_file(trace.xml_file, :filename => "#{trace.id}.xml", :type => request.format.to_s, :disposition => "attachment")
- send_file(trace.xml_file, :filename => "#{trace.id}.gpx", :type => request.format.to_s, :disposition => 'attachment')
+ send_file(trace.xml_file, :filename => "#{trace.id}.gpx", :type => request.format.to_s, :disposition => "attachment")
- send_file(trace.trace_name, :filename => "#{trace.id}#{trace.extension_name}", :type => trace.mime_type, :disposition => 'attachment')
+ send_file(trace.trace_name, :filename => "#{trace.id}#{trace.extension_name}", :type => trace.mime_type, :disposition => "attachment")
elsif @user.nil? || @trace.user != @user
render :text => "", :status => :forbidden
else
elsif @user.nil? || @trace.user != @user
render :text => "", :status => :forbidden
else
if params[:trace]
@trace.description = params[:trace][:description]
@trace.tagstring = params[:trace][:tagstring]
@trace.visibility = params[:trace][:visibility]
if @trace.save
if params[:trace]
@trace.description = params[:trace][:description]
@trace.tagstring = params[:trace][:tagstring]
@trace.visibility = params[:trace][:visibility]
if @trace.save
redirect_to :action => :list, :display_name => @user.display_name
end
rescue ActiveRecord::RecordNotFound
redirect_to :action => :list, :display_name => @user.display_name
end
rescue ActiveRecord::RecordNotFound
@traces = @traces.order("timestamp DESC")
@traces = @traces.limit(20)
@traces = @traces.includes(:user)
@traces = @traces.order("timestamp DESC")
@traces = @traces.limit(20)
@traces = @traces.includes(:user)
if trace.inserted?
if trace.public? || (@user && @user == trace.user)
expires_in 7.days, :private => !trace.public?, :public => trace.public?
if trace.inserted?
if trace.public? || (@user && @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')
+ send_file(trace.large_picture_name, :filename => "#{trace.id}.gif", :type => "image/gif", :disposition => "inline")
if trace.inserted?
if trace.public? || (@user && @user == trace.user)
expires_in 7.days, :private => !trace.public?, :public => trace.public?
if trace.inserted?
if trace.public? || (@user && @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')
+ send_file(trace.icon_picture_name, :filename => "#{trace.id}_icon.gif", :type => "image/gif", :disposition => "inline")
if trace.public? || trace.user == @user
if request.format == Mime::XML || request.format == Mime::GPX
if trace.public? || trace.user == @user
if request.format == Mime::XML || request.format == Mime::GPX
- send_file(trace.xml_file, :filename => "#{trace.id}.xml", :type => request.format.to_s, :disposition => 'attachment')
+ send_file(trace.xml_file, :filename => "#{trace.id}.xml", :type => request.format.to_s, :disposition => "attachment")
- send_file(trace.trace_name, :filename => "#{trace.id}#{trace.extension_name}", :type => trace.mime_type, :disposition => 'attachment')
+ send_file(trace.trace_name, :filename => "#{trace.id}#{trace.extension_name}", :type => trace.mime_type, :disposition => "attachment")
def do_create(file, tags, description, visibility)
# Sanitise the user's filename
def do_create(file, tags, description, visibility)
# Sanitise the user's filename