diff --git a/app/logical/moderator/ip_addr_search.rb b/app/logical/moderator/ip_addr_search.rb index 95c7a9bbd..eddc64f3f 100644 --- a/app/logical/moderator/ip_addr_search.rb +++ b/app/logical/moderator/ip_addr_search.rb @@ -32,6 +32,7 @@ module Moderator add_row(sums, "select updater_id as k, count(*) from note_versions where updater_ip_addr in (?) group by k", ip_addrs) add_row(sums, "select updater_id as k, count(*) from pool_versions where updater_ip_addr in (?) group by k", ip_addrs) add_row(sums, "select updater_id as k, count(*) from wiki_page_versions where updater_ip_addr in (?) group by k", ip_addrs) + add_row(sums, "select from_id as k, count(*) from dmails where creator_ip_addr in (?) group by k", ip_addrs) sums end @@ -49,6 +50,7 @@ module Moderator add_row(sums, "select updater_ip_addr as k, count(*) from note_versions where updater_id in (?) group by k", user_ids) add_row(sums, "select updater_ip_addr as k, count(*) from pool_versions where updater_id in (?) group by k", user_ids) add_row(sums, "select updater_ip_addr as k, count(*) from wiki_page_versions where updater_id in (?) group by k", user_ids) + add_row(sums, "select creator_ip_addr as k, count(*) from dmails where from_id in (?) group by k", user_ids) sums end diff --git a/app/views/dmails/show.html.erb b/app/views/dmails/show.html.erb index 95e95ec2b..0e4964bff 100644 --- a/app/views/dmails/show.html.erb +++ b/app/views/dmails/show.html.erb @@ -8,6 +8,9 @@
  • Sender: <%= link_to_user @dmail.from %>
  • Recipient: <%= link_to_user @dmail.to %>
  • Date: <%= compact_time(@dmail.created_at) %>
  • + <% if CurrentUser.user.is_moderator? %> +
  • Sender IP: <%= @dmail.creator_ip_addr %>
  • + <% end %>

    Body

    diff --git a/db/migrate/20140221213349_add_ip_addr_to_dmails.rb b/db/migrate/20140221213349_add_ip_addr_to_dmails.rb index e0cc7c018..3e1599a9a 100644 --- a/db/migrate/20140221213349_add_ip_addr_to_dmails.rb +++ b/db/migrate/20140221213349_add_ip_addr_to_dmails.rb @@ -1,5 +1,6 @@ class AddIpAddrToDmails < ActiveRecord::Migration def change add_column :dmails, :creator_ip_addr, :inet, :null => false, :default => "127.0.0.1" + add_index :dmails, :creator_ip_addr end end