Standalone change pw 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

Standalone change pw script?

Started by frankyk, 13 March, 2004, 01:33:00

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

frankyk

Hi, I run a hub and I was curious to see if there was a standalone script that users could type in +changepw and change their password.  I've been taking registration and entering their password but it takes a long time so I was wondering if there was a script that would allow users to change their pw while online in the hub and it would change the little registration profile in my server software itself.

The hub is pw protected so that only regged users can log in.

Thanks!

PS - I did a few searches, but I couldn't find anything that was standalone or was decodeable to just take that line of code only.

BlazeXxX

I didn't get time to check the script, whether its working or not.. so give it a try and let me knwo if its working.

-- Written by BlazeXxX
-- Requested by frankyk
-- Start copying from here

sBot = "PassChanger"

function Main()
frmHub:RegBot(sBot)
end

function DataArrival(user, data)
   if (cmd=="!repass") then
   if user.iProfile >= 0 then
   local usersprofile = user.iProfile
   _,_,cmd,arg = strfind( data, "%b<>%s+(%S+)%s+(.+)" )
   if arg == nil then user:SendData(sBot, "Enter a new password!") return 1 end
   AddRegUser(user.sName, arg, usersprofile)
   SendToNick(user.sName, "<" ..sBot.."> Your password has been changed to: "..arg)
   return 1
   end
        end
end

-- Finish copying

plop

QuoteOriginally posted by BlazeXxX
I didn't get time to check the script, whether its working or not.. so give it a try and let me knwo if its working.

-- Written by BlazeXxX
-- Requested by frankyk
-- Start copying from here

sBot = "PassChanger"

function Main()
frmHub:RegBot(sBot)
end

function DataArrival(user, data)
   if (cmd=="!repass") then
   if user.iProfile >= 0 then
   local usersprofile = user.iProfile
   _,_,cmd,arg = strfind( data, "%b<>%s+(%S+)%s+(.+)" )
   if arg == nil then user:SendData(sBot, "Enter a new password!") return 1 end
   AddRegUser(user.sName, arg, usersprofile)
   SendToNick(user.sName, "<" ..sBot.."> Your password has been changed to: "..arg)
   return 1
   end
        end
end

-- Finish copying
pls use the code tags 2 post scripts.
this will cause a minor problem, as it doesn't overwrite the old entry in the reg list.
insert a delete before the add and it should work.

plop
http://www.plop.nl lua scripts/howto\'s.
http://www.thegoldenangel.net
http://www.vikingshub.com
http://www.lua.org

>>----> he who fights hatred with hatred, drives the spreading of hatred <----<<

Skrollster

changed it a bit, and fixed some buggs....

-- Written by BlazeXxX 
-- Requested by frankyk 
-- Start copying from here 
-- Debugged Skrollster

sBot = "PassChanger" 

function Main() 
	frmHub:RegBot(sBot) 
end 

function DataArrival(user, data) 
	local _,_,cmd,password = strfind( data, "%b<>%s+(%S+)%s+(.+)" )
	local userProfile = user.iProfile
	if (cmd=="+changepw") and userProfile >= 0 then 
		if not password then
			user:SendData(sBot, "Enter a new password!")
			return 1
		else
			DelRegUser(user.sName)
			AddRegUser(user.sName, password, userProfile ) 
			user:SendData(sBot, "Your password has been changed to: "..password) 
			return 1 
		end 
	end 
end

frankyk

I tried it out, works fine other than when the Password is changed, it changes the PW and adds a | at the very end of the pw which messes the new password up.

Can you change it so when I type +changepw frank for example, it will store "frank" as the pw and not "frank|"

Skrollster

#5
-- Written by BlazeXxX 
-- Requested by frankyk 
-- Start copying from here 
-- Debugged Skrollster

sBot = "PassChanger" 

function Main() 
	frmHub:RegBot(sBot) 
end 

function DataArrival(user, data) 
	data=strsub(data,1,strlen(data)-1)
	local _,_,cmd,password = strfind( data, "%b<>%s+(%S+)%s+(%C+)" )
	local userProfile = user.iProfile
	if (cmd=="+changepw") and userProfile >= 0 then 
		if not password then
			user:SendData(sBot, "Enter a new password!")
			return 1
		else
			DelRegUser(user.sName)
			AddRegUser(user.sName, password, userProfile ) 
			user:SendData(sBot, "Your password has been changed to: "..password) 
			return 1 
		end 
	end 
end

*edit* changed it, thx

NotRabidWombat

DO NOT USE ANY OF THE ABOVE EXAMPLES.

This opens an exploit in PtokaX.

Instead of:
"%b<>%s+(%S+)%s+(.+)"
Use:
"%b<>%s+(%S+)%s+(%C+)"

-NotRabidWombat


I like childish behavior. Maybe this post will be deleted next.

SMF spam blocked by CleanTalk