Masters ability to change passwords
 

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

Masters ability to change passwords

Started by jsjen, 06 January, 2005, 10:18:12

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

jsjen

Hi there, I am wondering if there is a way for ops and masters to change passwords for users when they forget and get banned?


Cheers jason

im using Robocop v9.0f

bastya_elvtars

yep there is, altho no time here 2 write :)

the idea itself owns!
Everything could have been anything else and it would have just as much meaning.

Themaster

maybe this will help you out
-- Set a Bot Name
sBot = "Password"

-- Prefix to use
sPrefix = "+"

-- Commands
sCOM1 = "mypass"
sCOM2 = "repass"
sCOM3 = "changepass"
sCOM4 = "getpass"
sCOM5 = "passwordlist"


-----------------------------------------------------------------------------------
tPassword = {};
tProfiles = {};
-----------------------------------------------------------------------------------
function Main()
	readfrom("../RegisteredUsers.dat")
	while 1 do
		line = read()
		if line == nil then break end
		local s,e,sName,sPassword,sProfile = strfind(line,"(.+)|(.+)|(.+)")
		tPassword[sName] = {Profile = sProfile,Password = sPassword}
	end
	readfrom()

	readfrom("../Profiles.dat")
	while 1 do
		line = read()
		if line == nil then break end
		local s,e,sProfile,sName = strfind(line,"(%d+)|(%S+)|%d+")
		tProfiles[sName] = tonumber(sProfile)
	end
	readfrom()
end
-----------------------------------------------------------------------------------
function DataArrival(user,sData)
	if ( strsub( sData,1,1 ) == "<" ) then
		sData = strsub( sData,1,-2 )
		local s,e,sCmd = strfind(sData,"^%b<>%s+(%S+)")
		if ( strsub( sCmd,1,1 ) == sPrefix ) then
			sCmd = strsub( sCmd,2,-1 )
			sCmd = strlower(sCmd)
			if ( sCmd == sCOM1 ) then
				if (user.iProfile ~= -1) then
					if (tPassword[user.sName]) then
						user:SendData(sBot,"Your password is : \""..tPassword[user.sName].Password.."\", Keep it in a safe place!")
						return 1
					else
						user:SendData(sBot,"For some reason you could not be found!")
						return 1
					end
				end
			elseif ( sCmd == sCOM2 ) then
				if (user.iProfile ~= -1) then
					local s,e,sPass = strfind(sData,"^%b<>%s+%S+%s+(%S+)")
					if sPass and strlen(sPass) >= 4 then
						AddRegUser(user.sName,sPass,3)
						user:SendData(sBot,"Sucessfully changed your password!")
						return 1
					else
						user:SendData(sBot,"Either you didn't enter a password or it was too short, Password must be atleast 4 characters!")
						return 1
					end
				else
					user:SendData(sBot,"You are not registered!")
					return 1
				end
			elseif ( sCmd == sCOM3 ) then
				if (user.iProfile == 0) then
					local s,e,Name,Pass = strfind(sData,"^%b<>%s+%S+%s+(%S+)%s*(%S+)")
					if Name then
						if Pass and strlen(Pass) >= 4 then
							if tPassword[Name] then
								Profile = tonumber(tPassword[Name].Profile)
								AddRegUser(Name,Pass,Profile)
								user:SendData(sBot,"You have sucessfully changed password of "..Name.." to \""..Pass.."\"")
								return 1
							else
								user:SendData(sBot,"\""..Name.."\" is not registered on this hub!")
								return 1
							end
						else
							user:SendData(sBot,"Either you didn't enter a password or it was too short, Password must be atleast 4 characters!")
							return 1
						end
					else
						user:SendData(sBot,"Please enter a name that you will change password for!")
						return 1
					end
				end
			elseif ( sCmd == sCOM4 ) then
				if (user.iProfile == 0) then
					local s,e,Name = strfind(sData,"^%b<>%s+%S+%s+(%S+)")
					if Name then
						if (tPassword[Name]) then
							user:SendData(sBot,"\""..Name.."\"'s Password is : \""..tPassword[Name].Password.."\"")
							return 1
						else
							user:SendData(sBot,"\""..Name.."\" is not registered in this hub!")
							return 1
						end
					else
						user:SendData(sBot,"Please enter a name to get his / hers password!")
						return 1
					end
				end
			elseif ( sCmd == sCOM5 ) then
				if (user.iProfile == 0) then
					local s,e,sPro = strfind(sData,"^%b<>%s+%S+%s+(%S+)")
					if sPro then
						if (tProfiles[sPro]) then
							Idx = GetProfileIdx(sPro)
							Profiles = GetUsersByProfile(sPro)
							sMsg = ""
							for i,v in Profiles do
								sMsg = sMsg.."( "..v.." )\r\nPassword : "..tPassword[v].Password.."\r\n\r\n"
							end
							user:SendData(sBot,"\r\n\r\n"..sMsg)
							return 1
						else
							user:SendData(sBot,"\""..sPro.."\" is not a valid profile name!")
							return 1
						end
					else
						user:SendData(sBot,"Please enter a profile name, etc : "..sPrefix..sCOM5.." VIP")
						return 1
					end
				end
			end
		end
	end
end
peace out...and love to your all scripter..that do the hard work  :D And all thx to your all there are here 2 help!!! :]

blade.lir.dk

Anna

#3
I found it a cool script so I figured I'll try it... but it dont seem to work :(

*edit* found the problem, I'm set as NetFounder... it only works for thoose set as master...

is there any way it can be altered, smothly, to include other profiles (I can obviously copy the code part and enter the correct profilenumber if I wanna allow more to do it, but I have a feeling its not a smooth way)

mypass and repass works, but cant seem to get the others to work :(

Madman

#4
-- Set a Bot Name
sBot = "Password"

-- Prefix to use
sPrefix = "+"

-- Commands
sCOM1 = "mypass"
sCOM2 = "repass"
sCOM3 = "changepass"
sCOM4 = "getpass"
sCOM5 = "passwordlist"

AllowedProfiles = { -- Set 1 To Allow Command sCOM 3-5
	[0] = 1,	-- Masters
	[1] = 0,	-- Operators
	[2] = 0,	-- VIP
	[3] = 0,	-- Reg
	[4] = 0,	-- Moderator
	[5] = 1,	-- NetFounder
}

-----------------------------------------------------------------------------------
tPassword = {};
tProfiles = {};
-----------------------------------------------------------------------------------
function Main()
	readfrom("../RegisteredUsers.dat")
	while 1 do
		line = read()
		if line == nil then break end
		local s,e,sName,sPassword,sProfile = strfind(line,"(.+)|(.+)|(.+)")
		tPassword[sName] = {Profile = sProfile,Password = sPassword}
	end
	readfrom()

	readfrom("../Profiles.dat")
	while 1 do
		line = read()
		if line == nil then break end
		local s,e,sProfile,sName = strfind(line,"(%d+)|(%S+)|%d+")
		tProfiles[sName] = tonumber(sProfile)
	end
	readfrom()
end
-----------------------------------------------------------------------------------
function DataArrival(user,sData)
	if ( strsub( sData,1,1 ) == "<" ) then
		sData = strsub( sData,1,-2 )
		local s,e,sCmd = strfind(sData,"^%b<>%s+(%S+)")
		if ( strsub( sCmd,1,1 ) == sPrefix ) then
			sCmd = strsub( sCmd,2,-1 )
			sCmd = strlower(sCmd)
			if ( sCmd == sCOM1 ) then
				if (user.iProfile ~= -1) then
					if (tPassword[user.sName]) then
						user:SendData(sBot,"Your password is : \""..tPassword[user.sName].Password.."\", Keep it in a safe place!")
						return 1
					else
						user:SendData(sBot,"For some reason you could not be found!")
						return 1
					end
				end
			elseif ( sCmd == sCOM2 ) then
				if (user.iProfile ~= -1) then
					local s,e,sPass = strfind(sData,"^%b<>%s+%S+%s+(%S+)")
					if sPass and strlen(sPass) >= 4 then
						AddRegUser(user.sName,sPass,3)
						user:SendData(sBot,"Sucessfully changed your password to: \""..tPassword[user.sName].Password)
						return 1
					else
						user:SendData(sBot,"Either you didn't enter a password or it was too short, Password must be atleast 4 characters!")
						return 1
					end
				else
					user:SendData(sBot,"You are not registered!")
					return 1
				end
			elseif ( sCmd == sCOM3 ) then
				if AllowedProfiles[user.iProfile]==1 then
					local s,e,Name,Pass = strfind(sData,"^%b<>%s+%S+%s+(%S+)%s*(%S+)")
					if Name then
						if Pass and strlen(Pass) >= 4 then
							if tPassword[Name] then
								Profile = tonumber(tPassword[Name].Profile)
								AddRegUser(Name,Pass,Profile)
								user:SendData(sBot,"You have sucessfully changed password of "..Name.." to \""..Pass.."\"")
								return 1
							else
								user:SendData(sBot,"\""..Name.."\" is not registered on this hub!")
								return 1
							end
						else
							user:SendData(sBot,"Either you didn't enter a password or it was too short, Password must be atleast 4 characters!")
							return 1
						end
					else
						user:SendData(sBot,"Please enter a name that you will change password for!")
						return 1
					end
				end
			elseif ( sCmd == sCOM4 ) then
				if AllowedProfiles[user.iProfile]==1 then
					local s,e,Name = strfind(sData,"^%b<>%s+%S+%s+(%S+)")
					if Name then
						if (tPassword[Name]) then
							user:SendData(sBot,"\""..Name.."\"'s Password is : \""..tPassword[Name].Password.."\"")
							return 1
						else
							user:SendData(sBot,"\""..Name.."\" is not registered in this hub!")
							return 1
						end
					else
						user:SendData(sBot,"Please enter a name to get his / hers password!")
						return 1
					end
				end
			elseif ( sCmd == sCOM5 ) then
				if AllowedProfiles[user.iProfile]==1 then
					local s,e,sPro = strfind(sData,"^%b<>%s+%S+%s+(%S+)")
					if sPro then
						if (tProfiles[sPro]) then
							Idx = GetProfileIdx(sPro)
							Profiles = GetUsersByProfile(sPro)
							sMsg = ""
							for i,v in Profiles do
								sMsg = sMsg.."( "..v.." )\r\nPassword : "..tPassword[v].Password.."\r\n\r\n"
							end
							user:SendData(sBot,"\r\n\r\n"..sMsg)
							return 1
						else
							user:SendData(sBot,"\""..sPro.."\" is not a valid profile name!")
							return 1
						end
					else
						user:SendData(sBot,"Please enter a profile name, etc : "..sPrefix..sCOM5.." VIP")
						return 1
					end
				end
			end
		end
	end
end
Try this....
We suffer in silence, we lurk in the shadows, we kill in the night
Site currently down, ETA of returning online is 2099 ;p

Anna

Thanx, works fine now :D

jsjen

I would have thought there would have been one already
thanks heaps for the quick response mate

kepp

If you tried a search you would have found it
Guarding    

SMF spam blocked by CleanTalk