-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
People with space in their password cannot change it #19
Comments
changing the command in to two steps |
That is one approach. Another thing that we can do is this: Change the pattern here to: s1 = 'old pass newpass'
s2 = 'oldpass newpass'
s3 = 'oldpass new pass'
s4 = 'old pass new pass'
s1:match "(%S+ ?%S*) (%S+)|$" -- 1st captured group = 'old pass' 2nd captured group = 'newpass'
s2:match "(%S+ ?%S*) (%S+)|$" -- 1st captured group = 'oldpass' 2nd captured group = 'newpass'
s3:match "(%S+ ?%S*) (%S+)|$" -- 1st captured group = 'oldpass new' 2nd captured group = 'pass'
s4:match "(%S+ ?%S*) (%S+)|$" -- 1st captured group = 'pass new' 2nd captured group = 'pass' @KuZon1's suggestion is good, if it is not too much pain to change right click commands. |
What about the case when my password has more than one space? For eg. @KuZon1 While your suggestion certainly is one way to go, it'd be too cumbersome to manage. Consider for eg. I try to change my password today. I send in We can use the user's existing password in the pattern instead, and match everything that follows afterwards to be accepted as new password choice: local sPattern = ( "%%b<> [-+*/?#!]%%w+ %s (.+)|$" ):format( RegMan.GetReg(tUser.sNick).sPassword )
local sNewPass = sData:match( sPattern )
if sNewPass then
-- simply update user's password |
@hjpotter92 we can use timeout option If we use this code we can capture newpass
I think we should restrict space in newpass in order to verify oldpass. |
Gives this error
Being caused due to choice of delimiter (space). Can be fixed by changing the delimiter to something else or by not allowing people to have space in their password.
The text was updated successfully, but these errors were encountered: