- before_filter :authorize_web
- before_filter :set_locale
- before_filter :redirect_browse_params, :only => :index
- before_filter :redirect_map_params, :only => [:index, :edit, :export]
- before_filter :require_user, :only => [:welcome]
- before_filter :require_oauth, :only => [:index]
+ before_action :authorize_web
+ before_action :set_locale
+ before_action :redirect_browse_params, :only => :index
+ before_action :redirect_map_params, :only => [:index, :edit, :export]
+ before_action :require_user, :only => [:welcome]
+ before_action :require_oauth, :only => [:index]
- unless STATUS == :database_readonly or STATUS == :database_offline
- session[:location] ||= OSM::IPLocation(request.env['REMOTE_ADDR'])
+ unless STATUS == :database_readonly || STATUS == :database_offline
+ session[:location] ||= OSM.ip_location(request.env["REMOTE_ADDR"])
- lon, lat, zoom = ShortLink::decode(params[:code])
- new_params = params.except(:code, :lon, :lat, :zoom, :node, :way, :relation, :changeset)
+ lon, lat, zoom = ShortLink.decode(params[:code])
+ new_params = params.except(:code, :lon, :lat, :zoom, :layers, :node, :way, :relation, :changeset)
- if params.has_key? :node
- new_params[:controller] = 'browse'
- new_params[:action] = 'node'
+ if params.key? :node
+ new_params[:controller] = "browse"
+ new_params[:action] = "node"
- elsif params.has_key? :way
- new_params[:controller] = 'browse'
- new_params[:action] = 'way'
+ elsif params.key? :way
+ new_params[:controller] = "browse"
+ new_params[:action] = "way"
- elsif params.has_key? :relation
- new_params[:controller] = 'browse'
- new_params[:action] = 'relation'
+ elsif params.key? :relation
+ new_params[:controller] = "browse"
+ new_params[:action] = "relation"
- elsif params.has_key? :changeset
- new_params[:controller] = 'browse'
- new_params[:action] = 'changeset'
+ elsif params.key? :changeset
+ new_params[:controller] = "browse"
+ new_params[:action] = "changeset"