From: Steve Coast Date: Sat, 7 Apr 2007 12:17:11 +0000 (+0000) Subject: API returns user info if public X-Git-Tag: live~9089 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/2f55a3f0a80974922678d7677902d169b3481693 API returns user info if public --- diff --git a/app/models/node.rb b/app/models/node.rb index dfc603376..230b0f9a7 100644 --- a/app/models/node.rb +++ b/app/models/node.rb @@ -10,7 +10,6 @@ class Node < ActiveRecord::Base has_many :old_nodes, :foreign_key => :id belongs_to :user - def self.from_xml(xml, create=false) p = XML::Parser.new p.string = xml @@ -88,6 +87,7 @@ class Node < ActiveRecord::Base el1['id'] = self.id.to_s el1['lat'] = self.latitude.to_s el1['lon'] = self.longitude.to_s + el1['user'] = self.user.display_name if self.user.data_public? Node.split_tags(el1, self.tags) el1['visible'] = self.visible.to_s el1['timestamp'] = self.timestamp.xmlschema diff --git a/app/models/old_node.rb b/app/models/old_node.rb index 7b6162d8d..0bb676ef5 100644 --- a/app/models/old_node.rb +++ b/app/models/old_node.rb @@ -20,6 +20,7 @@ class OldNode < ActiveRecord::Base el1['id'] = self.id.to_s el1['lat'] = self.latitude.to_s el1['lon'] = self.longitude.to_s + el1['user'] = self.user.display_name if self.user.data_public? Node.split_tags(el1, self.tags) el1['visible'] = self.visible.to_s el1['timestamp'] = self.timestamp.xmlschema diff --git a/app/models/old_segment.rb b/app/models/old_segment.rb index 315f4dda7..7eac278fe 100644 --- a/app/models/old_segment.rb +++ b/app/models/old_segment.rb @@ -20,6 +20,7 @@ class OldSegment < ActiveRecord::Base el1['id'] = self.id.to_s el1['from'] = self.node_a.to_s el1['to'] = self.node_b.to_s + el1['user'] = self.user.display_name if self.user.data_public? Segment.split_tags(el1, self.tags) el1['visible'] = self.visible.to_s el1['timestamp'] = self.timestamp.xmlschema diff --git a/app/models/old_way.rb b/app/models/old_way.rb index 6682c644a..4a5362bc1 100644 --- a/app/models/old_way.rb +++ b/app/models/old_way.rb @@ -81,6 +81,7 @@ class OldWay < ActiveRecord::Base el1['id'] = self.id.to_s el1['visible'] = self.visible.to_s el1['timestamp'] = self.timestamp.xmlschema + el1['user'] = self.user.display_name if self.user.data_public? self.old_segments.each do |seg| # FIXME need to make sure they come back in the right order e = XML::Node.new 'seg' diff --git a/app/models/segment.rb b/app/models/segment.rb index cf0ec2061..f4909c7d2 100644 --- a/app/models/segment.rb +++ b/app/models/segment.rb @@ -82,6 +82,7 @@ class Segment < ActiveRecord::Base el1['id'] = self.id.to_s el1['from'] = self.node_a.to_s el1['to'] = self.node_b.to_s + el1['user'] = self.user.display_name if self.user.data_public? Segment.split_tags(el1, self.tags) el1['visible'] = self.visible.to_s el1['timestamp'] = self.timestamp.xmlschema diff --git a/app/models/way.rb b/app/models/way.rb index d568cb026..a6e0cecf9 100644 --- a/app/models/way.rb +++ b/app/models/way.rb @@ -62,7 +62,7 @@ class Way < ActiveRecord::Base el1['id'] = self.id.to_s el1['visible'] = self.visible.to_s el1['timestamp'] = self.timestamp.xmlschema - + el1['user'] = self.user.display_name if self.user.data_public? # make sure segments are output in sequence_id order ordered_segments = [] self.way_segments.each do |seg|