X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/1733e8990a242d7d4b3834b7cec2118597d685bd..e5a5f957ef46d76ec78e2c0450b50a086dff82b6:/app/controllers/api_controller.rb diff --git a/app/controllers/api_controller.rb b/app/controllers/api_controller.rb index 976c8bd03..7451a91b9 100644 --- a/app/controllers/api_controller.rb +++ b/app/controllers/api_controller.rb @@ -3,11 +3,18 @@ class ApiController < ApplicationController before_filter :authorize after_filter :compress_output + helper :user + model :user + + def authorize_web + @current_user = User.find_by_token(session[:token]) + end + # The maximum area you're allowed to request, in square degrees MAX_REQUEST_AREA = 0.25 def map - response.headers["Content-Type"] = 'application/xml' + response.headers["Content-Type"] = 'text/xml' # Figure out the bbox bbox = params['bbox'] unless bbox and bbox.count(',') == 3 @@ -68,7 +75,7 @@ class ApiController < ApplicationController # get missing nodes if there are any nodes += Node.find(missing_nodes) if missing_nodes.length > 0 - doc = OSM::API.get_xml_doc + doc = OSM::API.new.get_xml_doc # get ways # find which ways are needed