X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/a61e2ed69047cc4756d4ba11617ea1b2c2ff98cb..8edf08405db64afcd1207a9f1d33039ea1e23cfb:/app/controllers/user_controller.rb diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb index 6561d46fb..f3ec2e243 100644 --- a/app/controllers/user_controller.rb +++ b/app/controllers/user_controller.rb @@ -1,7 +1,7 @@ class UserController < ApplicationController layout 'site' - before_filter :authorize, :only => :preferences + before_filter :authorize, :only => [:preferences, :api_details, :api_gpx_files] before_filter :authorize_web, :only => [:rename, :account, :go_public] before_filter :require_user, :only => [:rename, :account, :go_public] @@ -125,5 +125,17 @@ class UserController < ApplicationController render :status => 400, :nothing => true end end + + def api_details + render :text => @user.to_xml.to_s + end + + def api_gpx_files + doc = OSM::API.new.get_xml_doc + @user.traces.each do |trace| + doc.root << trace.to_xml_node() if trace.public? or trace.user == @user + end + render :text => doc.to_s + end end