redirect_to quickvote_url( :ident => params[:ident] )
end
- def mapvoters
+ def list_voters
@map = GMap.new("map_div_id")
@map.control_init(:large_map => true, :map_type => true)
center = nil
-
- QuickVote.ident_to_quickvote(params[:id]).voters.each do |voter|
+ @election=QuickVote.ident_to_quickvote(params[:id])
+ @election.voters.each do |voter|
next unless voter.ipaddress
-
location = GeoKit::Geocoders::IpGeocoder.geocode(voter.ipaddress)
next unless location.lng and location.lat
--- /dev/null
+<%= GMap.header %>
+
+<div id="title-header">
+ <span class="header">Quickvote</span>
+ <span class="subheader">Voters</span>
+ </div>
+
+ <div class="clear-div"></div>
+<%= @map.to_html %>
+<%= @map.div(:width => 550, :height => 400) %>
+<br><br>
+<table class="voterbox">
+<tr>
+<th>IP/Host</th>
+<th>Organization Name</th>
+</tr>
+<% for voter in @election.voters %>
+ <% next unless voter.voted? %>
+ <tr>
+ <td><% begin %>
+ <% raise ArgumentError.new, "Local Server" if voter.ipaddress == "127.0.0.1" %>
+ <% raise ArgumentError.new, "XML-RPC Voter" if voter.ipaddress == "XMLRPC Request" %>
+ <% # Test for intranet addresses to avoid untimely DNS timeouts.
+ # Of course the last regex is horrible; matches a few extra IP's that aren't intranet
+ raise ArgumentError.new, "Intranet: #{voter.ipaddress}" if voter.ipaddress =~
+ /^192\.168/ or voter.ipaddress =~ /^10\./ or voter.ipaddress =~ /^169\.254/ or
+ voter.ipaddress =~ /^172\.[1-3]/
+ %>
+ <% w= Whois::Whois.new(IPAddr.new(voter.ipaddress),true)%>
+ <%=h((w.host == nil or w.host.empty?) ? voter.ipaddress : w.host)%>
+ </td>
+ <td>
+ <%w.search_whois%>
+ <%=h (w.all.grep(/^(OrgName|org-name)/)[0] or "").sub(/^(OrgName|org-name)\:/,'').strip -%> - <%= (w.all.grep(/^(NetName|netname)/)[0] or "").sub(/^(NetName|netname)\:/,'').strip %>
+
+ <% rescue ArgumentError => err %>
+ <%=h err %>
+ </td>
+ <td><%=h err%>
+ <% rescue NoMethodError %>
+ DNS Unreachable
+ </td>
+ <td> DNS Unreachable
+ <% end %>
+ </td>
+ </tr>
+<% end %>
+</table>
+
+++ /dev/null
-<%= GMap.header %>
-<%= @map.to_html %>
-<%= @map.div(:width => 800, :height => 400) %>
<span class="subheader"></span>
</div>
-<p><%= link_to "[Stalk Voters]", :controller => "quickvote", :action => "mapvoters", :id => @election.id %></p>
-<table class="voterbox">
-<tr>
-<th>IP/Host</th>
-<th>Origin</th>
-<th>Vote</th>
-</tr>
-<% for voter in @election.voters %>
- <% next unless voter.voted? %>
- <tr>
- <td><% begin %>
- <% raise ArgumentError.new, "Local Server" if voter.ipaddress == "127.0.0.1" %>
- <% raise ArgumentError.new, "XML-RPC Voter" if voter.ipaddress == "XMLRPC Request" %>
- <% w= Whois::Whois.new(IPAddr.new(voter.ipaddress),true)%>
- <%=h((w.host == nil or w.host.empty?) ? voter.ipaddress : w.host)%>
- </td>
- <td>
- <%w.search_whois%>
- <%=h (w.all.grep(/^(OrgName|org-name)/)[0] or "").sub(/^(OrgName|org-name)\:/,'').strip -%> - <%= (w.all.grep(/^(NetName|netname)/)[0] or "").sub(/^(NetName|netname)\:/,'').strip %>
-
- <% rescue ArgumentError => err %>
- <%=h err %>
- </td>
- <td><%=h err%>
- <% rescue NoMethodError %>
- DNS Unreachable
- </td>
- <td> DNS Unreachable
- <% end %>
- </td>
- <td><%= voter.vote.votestring %></td>
- </tr>
-<% end %>
-</table>
-
+<p><%= link_to "[View All Voters]", :controller => "quickvote", :action => "list_voters", :id => @election.id %></p>
<br />
<!--
ABQIAAAAzMUFFnT9uH0xq39J0Y4kbhTJQa0g3IQ9GZqIMmInSLzwtGDKaBR6j135zrztfTGVOm2QlWnkaidDIQ\r
\r
production:\r
- thepochisuperstarmegashow.com: ABQIAAAAzMUFFnT9uH0Sfg76Y4kbhTJQa0g3IQ9GZqIMmInSLzwtGDmlRT6e90j135zat56yhJKQlWnkaidDIQ\r
- example.com: ABQIAAAAzMUFFnT9uH0Sfg98Y4kbhGFJQa0g3IQ9GZqIMmInSLrthJKGDmlRT98f4j135zat56yjRKQlWnkmod3TB\r
+ ABQIAAAAzMUFFnT9uH0Sfg98Y4kbhGFJQa0g3IQ9GZqIMmInSLrthJKGDmlRT98f4j135zat56yjRKQlWnkmod3TB\r