aboutsummaryrefslogtreecommitdiff
path: root/poll.rb
diff options
context:
space:
mode:
authorBenjamin Kellermann <Benjamin.Kellermann@gmx.de>2008-12-20 22:52:44 +0100
committerBenjamin Kellermann <Benjamin.Kellermann@gmx.de>2008-12-20 22:52:44 +0100
commit75fdd2ee19fc69acd7c037fab4e99a56d4ce99c8 (patch)
treec996ff4b6e5f42f35e8af173a25daac87f39039f /poll.rb
parenta502496f25430ddc3e665b0291ca6bcf056feb4d (diff)
exchanged empty participant with anonymous
Diffstat (limited to 'poll.rb')
-rw-r--r--poll.rb13
1 files changed, 8 insertions, 5 deletions
diff --git a/poll.rb b/poll.rb
index b0c49d0..19483c4 100644
--- a/poll.rb
+++ b/poll.rb
@@ -173,11 +173,14 @@ END
end
def add_participant(name, agreed)
htmlname = CGI.escapeHTML(name.strip)
- @data[htmlname] = {"timestamp" => Time.now }
- @head.each_key{|columntitle|
- @data[htmlname][columntitle] = agreed[columntitle.to_s]
- }
- store "Participant #{name.strip} edited"
+ if htmlname == ""
+ htmlname = "Anonymous ##{rand(1000)}"
+ end
+ @data[htmlname] = {"timestamp" => Time.now }
+ @head.each_key{|columntitle|
+ @data[htmlname][columntitle] = agreed[columntitle.to_s]
+ }
+ store "Participant #{name.strip} edited"
end
def invite_delete(name)
htmlname = CGI.escapeHTML(name.strip)