tempban with reason script
 

News:

29 December 2022 - PtokaX 0.5.3.0 (20th anniversary edition) released...
11 April 2017 - PtokaX 0.5.2.2 released...
8 April 2015 Anti child and anti pedo pr0n scripts are not allowed anymore on this board!
28 September 2015 - PtokaX 0.5.2.1 for Windows 10 IoT released...
3 September 2015 - PtokaX 0.5.2.1 released...
16 August 2015 - PtokaX 0.5.2.0 released...
1 August 2015 - Crowdfunding for ADC protocol support in PtokaX ended. Clearly nobody want ADC support...
30 June 2015 - PtokaX 0.5.1.0 released...
30 April 2015 Crowdfunding for ADC protocol support in PtokaX
26 April 2015 New support hub!
20 February 2015 - PtokaX 0.5.0.3 released...
13 April 2014 - PtokaX 0.5.0.2 released...
23 March 2014 - PtokaX testing version 0.5.0.1 build 454 is available.
04 March 2014 - PtokaX.org sites were temporary down because of DDOS attacks and issues with hosting service provider.

Main Menu

tempban with reason script

Started by Ubikk, 07 August, 2005, 17:57:53

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Ubikk

Right now if I tempban a user like this:

Quote!tempban testuser 2h because this_is_a_test
[/size]

the message this_is_a_test
will ony be displayed once like this:

Quote[15:11] You had been temp banned to: 2 min because: test
[15:11] *** Disconnected
[15:12] *** Connecting to 192.168.240.31...
[15:12] *** Connected
[15:12] You are temporarily banned for 2 min!
[15:12] *** Disconnected
[15:12] *** Connecting to 192.168.240.31...
[15:12] *** Connected
[15:12] You are temporarily banned for 2 min!
[15:12] *** Disconnected
[15:12] *** Connecting to 192.168.240.31...
[15:12] *** Connected
[15:12] You are temporarily banned for 2 min!
[15:12] *** Disconnected
[/size]

is it possible to show the ban message each time the user tries to connect?

.. something like this:

Quote[15:12] *** Connected
[15:12] You are temporarily banned for hr : mins , by user for this reason: Reason would be entered here (if given)
[/size]

Thanks in advance :)

bastya_elvtars

Either the XML files need update, or (and this is better) the whole ban thing should be stored in a database either standalone, or compiled into PtokaX). Scripted solution would kill the hub, since it should run through the banlist every minute to check whether the ban has expired. Imagine a banlist with 1000 people.
Everything could have been anything else and it would have just as much meaning.

Madman

QuoteOriginally posted by bastya_elvtars
Scripted solution would kill the hub, since it should run through the banlist every minute to check whether the ban has expired. Imagine a banlist with 1000 people.
Would it?
Cant GetTempBannedItemTime(IP) be used for that?
Use Serialize to create a file...with needed info...
In NewUserConnected, check if tempbanned, and then read from file for op and reason and use GetTempBannedItemTime(IP) to get the time?
We suffer in silence, we lurk in the shadows, we kill in the night
Site currently down, ETA of returning online is 2099 ;p

Ubikk

My hub is very small... i only have one or two bans in my list ;)

bastya_elvtars

"Cant GetTempBannedItemTime(IP) be used for that?
Use Serialize to create a file...with needed info...
In NewUserConnected, check if tempbanned, and then read from file for op and reason and use GetTempBannedItemTime(IP) to get the time?"

But what about banlist clearing after a loooooooong hub downtime?
Everything could have been anything else and it would have just as much meaning.

bastya_elvtars

But as tempban is parsed before user starts to log in, if an user is banned, there is no user object created.
Everything could have been anything else and it would have just as much meaning.

Dessamator

well u can use SupportsArrival.

btw heres a nice way to find out which arrivals are used when a user tries to login , and the order in which they are processed :

-- ParseArrivals by Dessamator
t ={}

function SupportsArrival(User, Data)		
table.insert(t,{os.clock(),"SupportsArrival"})
end

function KeyArrival(User, Data)		
table.insert(t,{os.clock(),"KeyArrival"})

end

function ValidateNickArrival(User, Data)		
table.insert(t,{os.clock(),"ValidateNickArrival"})
end

function PasswordArrival(User, Data)			
table.insert(t,{os.clock(),"PasswordArrival"})
end

function VersionArrival(User, Data)			
table.insert(t,{os.clock(),"VersionArrival"})
end

function GetNickListArrival(User, Data)		
table.insert(t,{os.clock(),"GetNickListArrival"})
end

function MyINFOArrival(User, Data)		
table.insert(t,{os.clock(),"MyINFOArrival"})
end

function GetINFOArrival(User, Data)			
table.insert(t,{os.clock(),"GetINFOArrival"})
end

function UserIPArrival(User, Data)			
table.insert(t,{os.clock(),"UserIPArrival"})
end

function UnknownArrival(User, Data)	
table.insert(t,{os.clock(),"UnknownArrival"})
end

function NewUserConnected(User,Data)
table.insert(t,{os.clock(),"NewUserConnected"})
end

function OpConnected(User,data)
table.insert(t,{os.clock(),"OPConnected"})
end

function SearchArrival(User, Data)
	table.insert(t,{os.clock(),"SearchArrival"})
end

function SRArrival(User, Data)	
	table.insert(t,{os.clock(),"Search Responce Arrival"})
end

function ChatArrival(user,data)
data=string.sub(data,1,-2)
local s,e,cmd = string.find(data,"%b<>%s+(%S+)")
local temp ="\r\n"
	
	if cmd=="!view" then
		table.sort(t, function(a, b) return (a[1] < b[1]) end)
		for i in ipairs(t) do 
			temp=temp.."Time taken : "..t[i][1].."  --> Name : "..t[i][2].."\r\n"
		end
	t =nil
	t ={}
	user:SendData(temp)
	return 1
	end
end
Ignorance is Bliss.

bastya_elvtars

Easier to view the PtokaX CMDs window. :P
However $Supports cannot be discarded anyway, and therefore it's stil processed by PtokaX. It needs a database, making it easier to process banned users and to store more information. This is something that should not be done by script.
Everything could have been anything else and it would have just as much meaning.

Dessamator

Indeed, but the cmd in ptokax is a bit confusing, that script simplifies it by only showing the arrival which was used, either way it was written for a previous version of ptokax.
But i do agree with you, a database is needed !
Ignorance is Bliss.

SMF spam blocked by CleanTalk