Can you explain more about how I'm supposed to run the code you posted? I'm not understanding.
Thanks,
-B
Anti hammer and banlist (IP Access)
-
- Site Admin
- Posts: 2080
- Joined: Tue Sep 29, 2009 6:09 am
Re: Anti hammer and banlist (IP Access)
You just need to copy/paste this code, the added code is for translating the boolean field into an integer.
-
- Posts: 7
- Joined: Thu Jan 27, 2011 8:26 pm
Re: Anti hammer and banlist (IP Access)
Ok I added the code but I get the same results.
Please advise.
-B
Please advise.
-B
-
- Site Admin
- Posts: 2080
- Joined: Tue Sep 29, 2009 6:09 am
Re: Anti hammer and banlist (IP Access)
I got it, you can only add such lua script into FTP/SSH event, but not HTTP event. Because when this event is triggered, user hasn't logged in, and there is no web session exists, so it can't call the variables like "%Domain", "%IP". Anyway, we will consider to improve it.
Code: Select all
local ipmasks = c_GetIPMaskList("%Domain")
local domain_ipmasks = {}
if type(ipmasks) == "table" then
for _,ipmask in pairs(ipmasks) do
local temp = {}
table.insert(temp,ipmask.ip)
table.insert(temp,ipmask.refuse)
table.insert(domain_ipmasks,temp)
end
end
table.insert(domain_ipmasks,{"%IP",true})
c_SetIPMaskList("%Domain",domain_ipmasks)