Record "XMLRPC Request" in ipadress field of XML RPC created votes.
[selectricity-live] / app / views / quickvote / results.rhtml
index 1fad7ea36a907186d565ff633e7877b0fe1613b6..98a71e54c97cdf8f05368832506b5b5ba8f5327d 100644 (file)
@@ -1,4 +1,4 @@
-<% %>
+<%require 'IPAddr' %>
 <h1>Results</h1>
 
 <% if @election.shortdesc %>
@@ -156,7 +156,13 @@ by several other names.</p>
   <% next unless voter.voted? %>
   <tr>
   <td><%= voter.ipaddress %></td>
-  <td><%= `host #{voter.ipaddress}`.sub(/^.*pointer (.*)\.$/, '\1') %></td>
+  <td><% begin %>
+      <%= `host #{IPAddr.new(voter.ipaddress).to_s}`.sub(/^.*pointer (.*)\.$/, '\1') %>
+    
+    <% rescue ArgumentError => err %>
+      <%= " - " %>
+    <% end %>
+    </td>
   <td><%= voter.vote.votestring %></td>
   </tr>
 <% end %>

Benjamin Mako Hill || Want to submit a patch?