add additional mod actions
This commit is contained in:
@@ -6,6 +6,12 @@ class IpBan < ActiveRecord::Base
|
||||
validates_format_of :ip_addr, :with => IP_ADDR_REGEX
|
||||
validates_uniqueness_of :ip_addr, :if => lambda {|rec| rec.ip_addr =~ IP_ADDR_REGEX}
|
||||
attr_accessible :ip_addr, :reason
|
||||
after_create do
|
||||
ModAction.log("#{CurrentUser.name} created ip ban for #{rec.ip_addr}")
|
||||
end
|
||||
after_destroy do
|
||||
ModAction.log("#{CurrentUser.name} deleted ip ban for ##{rec.ip_addr}")
|
||||
end
|
||||
|
||||
def self.is_banned?(ip_addr)
|
||||
exists?(["ip_addr = ?", ip_addr])
|
||||
@@ -31,7 +37,7 @@ class IpBan < ActiveRecord::Base
|
||||
return {
|
||||
"comments" => comments,
|
||||
"notes" => notes,
|
||||
"pools" => pools,
|
||||
# "pools" => pools,
|
||||
"wiki_pages" => wiki_pages
|
||||
}
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user