Page 2 of 2

Re: Anti hammer and banlist (IP Access)

Posted: Fri Feb 11, 2011 4:07 pm
by gockenbr
Can you explain more about how I'm supposed to run the code you posted? I'm not understanding.

Thanks,
-B

Re: Anti hammer and banlist (IP Access)

Posted: Fri Feb 11, 2011 4:12 pm
by FTP
You just need to copy/paste this code, the added code is for translating the boolean field into an integer.

Re: Anti hammer and banlist (IP Access)

Posted: Fri Feb 11, 2011 7:27 pm
by gockenbr
Ok I added the code but I get the same results.

Please advise.

-B

Re: Anti hammer and banlist (IP Access)

Posted: Thu Feb 17, 2011 5:09 am
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)