Fix #4106: Allow moderators to IP ban subnets.

This commit is contained in:
evazion
2019-08-12 02:12:56 -05:00
parent 9729eeb829
commit 7316f41d1d
6 changed files with 62 additions and 38 deletions

View File

@@ -14,8 +14,8 @@
<tbody>
<% @ip_bans.each do |ip_ban| %>
<tr>
<td><%= link_to_ip ip_ban.ip_addr %></td>
<td><%= ip_ban.creator.name %></td>
<td><%= link_to_ip ip_ban.subnetted_ip %></td>
<td><%= link_to_user ip_ban.creator %></td>
<td><%= ip_ban.reason %></td>
<td><%= link_to "Unban", ip_ban_path(ip_ban), :remote => true, :method => :delete, :data => {:confirm => "Do your really want to unban #{ip_ban.ip_addr}?"} %></td>
</tr>

View File

@@ -5,8 +5,8 @@
<%= error_messages_for "ip_ban" %>
<%= simple_form_for(@ip_ban) do |f| %>
<%= f.input :ip_addr, :label => "IP Address", :as => :string %>
<%= f.input :reason, :input_html => {:size => "50x5"} %>
<%= f.input :ip_addr, label: "IP Address", as: :string, hint: "Add /24 to ban a subnet. Example: 1.2.3.4/24" %>
<%= f.input :reason %>
<%= f.button :submit, "Submit" %>
<% end %>
</div>