include dmail ip addrs in search
This commit is contained in:
@@ -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 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 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 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
|
sums
|
||||||
end
|
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 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 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 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
|
sums
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -8,6 +8,9 @@
|
|||||||
<li><strong>Sender</strong>: <%= link_to_user @dmail.from %></li>
|
<li><strong>Sender</strong>: <%= link_to_user @dmail.from %></li>
|
||||||
<li><strong>Recipient</strong>: <%= link_to_user @dmail.to %></li>
|
<li><strong>Recipient</strong>: <%= link_to_user @dmail.to %></li>
|
||||||
<li><strong>Date</strong>: <%= compact_time(@dmail.created_at) %></li>
|
<li><strong>Date</strong>: <%= compact_time(@dmail.created_at) %></li>
|
||||||
|
<% if CurrentUser.user.is_moderator? %>
|
||||||
|
<li><strong>Sender IP</strong>: <%= @dmail.creator_ip_addr %></li>
|
||||||
|
<% end %>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<h3>Body</h3>
|
<h3>Body</h3>
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
class AddIpAddrToDmails < ActiveRecord::Migration
|
class AddIpAddrToDmails < ActiveRecord::Migration
|
||||||
def change
|
def change
|
||||||
add_column :dmails, :creator_ip_addr, :inet, :null => false, :default => "127.0.0.1"
|
add_column :dmails, :creator_ip_addr, :inet, :null => false, :default => "127.0.0.1"
|
||||||
|
add_index :dmails, :creator_ip_addr
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user