aboutsummaryrefslogtreecommitdiff
path: root/poll.rb
diff options
context:
space:
mode:
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)