Anti hammer and banlist (IP Access)

Post here if you have some suggestions or you want to request a new feature.
gockenbr
Posts: 7
Joined: Thu Jan 27, 2011 8:26 pm

Re: Anti hammer and banlist (IP Access)

Post by gockenbr »

Can you explain more about how I'm supposed to run the code you posted? I'm not understanding.

Thanks,
-B
FTP
Site Admin
Posts: 2072
Joined: Tue Sep 29, 2009 6:09 am

Re: Anti hammer and banlist (IP Access)

Post by FTP »

You just need to copy/paste this code, the added code is for translating the boolean field into an integer.
gockenbr
Posts: 7
Joined: Thu Jan 27, 2011 8:26 pm

Re: Anti hammer and banlist (IP Access)

Post by gockenbr »

Ok I added the code but I get the same results.

Please advise.

-B
FTP
Site Admin
Posts: 2072
Joined: Tue Sep 29, 2009 6:09 am

Re: Anti hammer and banlist (IP Access)

Post by FTP »

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)
Post Reply