X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/c9237a3583ac5720edce034f6bee1f248539191c..09fdee54938792f06ce5b0636f01440a17117add:/app/controllers/amf_controller.rb diff --git a/app/controllers/amf_controller.rb b/app/controllers/amf_controller.rb index 2b21221c0..7f85280b7 100644 --- a/app/controllers/amf_controller.rb +++ b/app/controllers/amf_controller.rb @@ -29,7 +29,7 @@ class AmfController < ApplicationController include Potlatch session :off - before_filter :check_write_availability + before_filter :check_api_writable # Main AMF handlers: process the raw AMF string (using AMF library) and # calls each action (private method) accordingly. @@ -126,8 +126,9 @@ class AmfController < ApplicationController # are IDs only. def whichways(xmin, ymin, xmax, ymax) #:doc: - xmin -= 0.01; ymin -= 0.01 - xmax += 0.01; ymax += 0.01 + enlarge = [(xmax-xmin)/8,0.01].min + xmin -= enlarge; ymin -= enlarge + xmax += enlarge; ymax += enlarge if POTLATCH_USE_SQL then way_ids = sql_find_way_ids_in_area(xmin, ymin, xmax, ymax) @@ -523,10 +524,10 @@ class AmfController < ApplicationController end # Authenticate token - # (could be removed if no-one uses the username+password form) + # (can also be of form user:pass) def getuserid(token) #:doc: - if (token =~ /^(.+)\+(.+)$/) then + if (token =~ /^(.+)\:(.+)$/) then user = User.authenticate(:username => $1, :password => $2) else user = User.authenticate(:token => token)