3 require File.join(File.dirname(__FILE__), "..", "config", "environment")
6 addresses = User.count(
8 :status => %w[suspended deleted],
9 :creation_time => Time.now.utc - 28.days..Time.now.utc
11 :group => :creation_address
14 addresses.each do |address, count|
16 next if Acl.exists?(:address => address)
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}"