3 require File.dirname(__FILE__) + '/../config/environment'
6 addresses = User.count(
8 :status => %w(suspended deleted),
9 :creation_time => Time.now - 28.days..Time.now
11 :group => :creation_ip
14 addresses.each do |address, count|
16 next if Acl.where(:address => address).exists?
20 :k => "no_account_creation",
21 :v => "auto_spam_block"
22 }, { :without_protection => true })
24 puts "Blocked #{address}"
27 acls = Acl.find(:all, :conditions => {
28 :k => "no_account_creation",
29 :v => "auto_spam_block"
33 next if addresses[acl.address]
37 puts "Unblocked #{acl.address}"