X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/bf29550db840c97cafffbe1e836750bef6c7942d..783528830ad1b0d5f07c8e758747841a0b4e5cc6:/app/controllers/trace_controller.rb diff --git a/app/controllers/trace_controller.rb b/app/controllers/trace_controller.rb index d94280a6a..06ae5dc3b 100644 --- a/app/controllers/trace_controller.rb +++ b/app/controllers/trace_controller.rb @@ -79,6 +79,12 @@ class TraceController < ApplicationController def mine if @user + @trace = Trace.new + unless @user.trace_public_default.nil? + @trace.public = true + else + @trace.public = false + end list(@user, "mine") unless @user.nil? else redirect_to :controller => 'user', :action => 'login', :referer => request.request_uri @@ -312,6 +318,17 @@ private else FileUtils.rm_f(filename) end + + # Finally save whether the user marked the trace as being public + if @trace.public? + if @user.trace_public_default.nil? + @user.preferences.create(:k => "gps.trace.public", :v => "default") + end + else + pref = @user.trace_public_default + pref.destroy unless pref.nil? + end + end end