- def dummydummy
-
- #
- # POST ???
- #
-
- if request.post?
- nodeid = r.args.match(/nodeid=([0-9]+)/).captures.first.to_i
- userid = dao.useridfromcreds(r.user, r.get_basic_auth_pw)
- doc = Document.new $stdin.read
-
- doc.elements.each('osm/node') do |pt|
- lat = pt.attributes['lat'].to_f
- lon = pt.attributes['lon'].to_f
- xmlnodeid = pt.attributes['id'].to_i
-
- tags = []
- pt.elements.each('tag') do |tag|
- tags << [tag.attributes['k'],tag.attributes['v']]
- end
-
- tags = tags.collect { |k,v| "#{k}=#{v}" }.join(';')
-
- tags = '' unless tags
- if xmlnodeid == nodeid && userid != 0
- if nodeid == 0
- new_node_id = dao.create_node(lat, lon, userid, tags)
- if new_node_id
- puts new_node_id
- exit
- else
- exit HTTP_INTERNAL_SERVER_ERROR
- end
- else
- node = dao.getnode(nodeid)
- if node
- #FIXME: need to check the node hasn't moved too much
- if dao.update_node?(nodeid, userid, lat, lon, tags)
- exit
- else
- exit HTTP_INTERNAL_SERVER_ERROR
- end
- else
- exit HTTP_NOT_FOUND
- end
- end
-
+ if node.visible
+ if WayNode.find(:first, :joins => "INNER JOIN current_ways ON current_ways.id = current_way_nodes.id", :conditions => [ "current_ways.visible = 1 AND current_way_nodes.node_id = ?", node.id ])
+ render :text => "", :status => :precondition_failed
+ elsif RelationMember.find(:first, :joins => "INNER JOIN current_relations ON current_relations.id=current_relation_members.id", :conditions => [ "visible = 1 AND member_type='node' and member_id=?", params[:id]])
+ render :text => "", :status => :precondition_failed