FIX: when adding an IP to the spammer list, check the broader ban list

first

FEATURE: allow admins to search users using IP ranges
This commit is contained in:
Régis Hanol
2014-11-21 18:16:06 +01:00
parent 0847cb5ea7
commit 0398ab7514
5 changed files with 32 additions and 18 deletions

16
lib/ip_addr.rb Normal file
View File

@ -0,0 +1,16 @@
class IPAddr
def to_cidr_s
if @addr
mask = @mask_addr.to_s(2).count('1')
if mask == 32
to_s
else
"#{to_s}/#{mask}"
end
else
nil
end
end
end