Please add a function which allow me block several IP and when someone is blocked script should send the reason of block.
e.g "Your account was blocked - please contact with the administrator" .
The message should be different than the messages for operators.
-- OpSecurity 0.1 Lua5
-- Small Op Account Protection script
-- by ']['yphoon?
-- thx to Mutor for helping me when being blind/stupid
-- write dynip to disable the check on the user
tSetup={}
tSetup.Bot = "botname"
tSetup.Email = "secured@net.nl"
tSetup.OpSecurity = {
[""] = "",
["opnick"] = "88.88.88.88",
}
function OpConnected(user)
if tSetup.OpSecurity[user.sName] then
local Name = user.sName
if ((tSetup.OpSecurity[Name] == user.sIP) or (tSetup.OpSecurity[Name] == "dynip")) then
user:SendPM(tSetup.Bot,"You have passed the IP-Check !")
else
local msg = ""
msg = msg.."\r\n\t\tYou Have Been Banned For Using A Op Account That Don't Belong To You"
msg = msg.."\r\n\t\tIf YOU really are an Operator at this hub,and just got a new Ip"
msg = msg.."\r\n\t\tThen Mail to this address "..tSetup.Email
user:SendData(tSetup.Bot,msg)
user:Ban()
Unban(Name)
end
end
end
Thanks in advance.
I think this is what you asked for - else shout and I'll redo it :)
-- OpSecurity 0.1 Lua5
-- Small Op Account Protection script
-- by ']['yphoon?
-- thx to Mutor for helping me when being blind/stupid
-- write dynip to disable the check on the user
tSetup={}
tSetup.Bot = "botname"
tSetup.Email = "secured@net.nl"
tSetup.OpSecurity = {
[""] = "",
["opnick"] = "88.88.88.88",
}
tSetup.BlockedIP = { -- Blocked IPs
["22.22.22.22"] = 1,
["22.22.22.22"] = 1,
["22.22.22.22"] = 1,
}
function OpConnected(user)
if tSetup.BlockedIP[user.sIP] then
user:SendData(tSetup.Bot,"Your account was blocked - please contact with the administrator")
user:Disconnect()
return 1
end
if tSetup.OpSecurity[user.sName] then
local Name = user.sName
if ((tSetup.OpSecurity[Name] == user.sIP) or (tSetup.OpSecurity[Name] == "dynip")) then
user:SendPM(tSetup.Bot,"You have passed the IP-Check !")
else
local msg = ""
msg = msg.."\r\n\t\tYou Have Been Banned For Using A Op Account That Don't Belong To You"
msg = msg.."\r\n\t\tIf YOU really are an Operator at this hub,and just got a new Ip"
msg = msg.."\r\n\t\tThen Mail to this address "..tSetup.Email
user:SendData(tSetup.Bot,msg)
user:Ban()
Unban(Name)
end
end
end
-Snooze (http://www.dixbot.com)
/Edit
Removed localhost to avoid confusion
Script is blocking only IP profile OP.
Is not blocking ip user: Vip, registered, unregistered. :(
Now includes all Profiles..
-- OpSecurity 0.1 Lua5
-- Small Op Account Protection script
-- by ']['yphoon?
-- thx to Mutor for helping me when being blind/stupid
-- write dynip to disable the check on the user
-- few modifications by Snooze
tSetup={}
tSetup.Bot = "botname"
tSetup.Email = "secured@net.nl"
tSetup.OpSecurity = {
[""] = "",
["opnick"] = "88.88.88.88",
}
tSetup.BlockedIP = { -- Blocked IPs
["22.22.22.22"] = 1,
["22.22.22.22"] = 1,
["22.22.22.22"] = 1,
}
OpConnected = function(user)
doBlockedIp(user)
if tSetup.OpSecurity[user.sName] then
local Name = user.sName
if ((tSetup.OpSecurity[Name] == user.sIP) or (tSetup.OpSecurity[Name] == "dynip")) then
user:SendPM(tSetup.Bot,"You have passed the IP-Check !")
else
local msg = ""
msg = msg.."\r\n\t\tYou Have Been Banned For Using A Op Account That Don't Belong To You"
msg = msg.."\r\n\t\tIf YOU really are an Operator at this hub,and just got a new Ip"
msg = msg.."\r\n\t\tThen Mail to this address "..tSetup.Email
user:SendData(tSetup.Bot,msg)
user:Ban()
Unban(Name)
end
end
end
NewUserConnected = function(user)
doBlockedIp(user)
end
doBlockedIp = function(user)
if tSetup.BlockedIP[user.sIP] then
user:SendData(tSetup.Bot,"Your account was blocked - please contact with the administrator") --<-- This is the message the blocked user will get!
user:Disconnect()
return 1
end
end
Greets,
Snooze (http://www.dixbot.com)
Script works well :)
Thank you very much, Snooze.
You're welcome :)
-Snooze (http://www.dixbot.com)