2 class UsersController < ApiController
3 before_action :check_api_readable
4 before_action :disable_terms_redirect, :only => [:details]
5 before_action :setup_user_auth, :only => [:show, :index]
6 before_action :authorize, :only => [:details, :gpx_files]
10 around_action :api_call_handle_error
11 load_resource :only => :show
13 before_action :set_request_formats, :except => [:gpx_files]
16 raise OSM::APIBadUserInput, "The parameter users is required, and must be of the form users=id[,id[,id...]]" unless params["users"]
18 ids = params["users"].split(",").collect(&:to_i)
20 raise OSM::APIBadUserInput, "No users were given to search for" if ids.empty?
22 @users = User.visible.where(:id => ids).in_order_of(:id, ids)
25 respond_to do |format|
34 respond_to do |format|
46 respond_to do |format|
47 format.xml { render :show }
48 format.json { render :show }
53 @traces = current_user.traces.reload
54 render :content_type => "application/xml"
59 def disable_terms_redirect
60 # this is necessary otherwise going to the user terms page, when
61 # having not agreed already would cause an infinite redirect loop.
62 # it's .now so that this doesn't propagate to other pages.
63 flash.now[:skip_terms] = true