Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Use only letters or numbers ?
Author Message
Alias
Journeyman
*

Posts: 107
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Apr 2012
Reputation: 0



Post: #1
Use only letters or numbers ?
Hello i have found this password change scp i download section, i have try lot of wyas to do this but still ca't get right, so how could i make when can use only Latin letters and numbers but cant use like )($@# and another languaces for example china.
here the script.
and here is what i was trying to add
Code:
if !(STRMATCH(*a*,*b*,*c*,*d*,<ARGTXT[0]> ))
  src.sysmessage cant.
  else
  SRC.PASSWORD <ARGTXT[0]>
  RETURN 1
ENDIF

Code:
[Function changepassword]
SRC.DIALOG d_password

[dialog d_password]
40,0  
page 0
noclose
nomove
GUMPPIC 130 150 5170 //Top Left
GUMPPIC 150 150 5171 //Top
GUMPPIC 250 150 5171 //Top
GUMPPIC 420 150 5172 //Top right
GUMPPIC 130 188 5173 //LEFT
GUMPPIC 168 188 5174 //MIDDLE
GUMPPIC 250 188 5174 //MIDDLE
GUMPPIC 420 188 5175 //RIGHT
GUMPPIC 130 300 5176 //Bottom Left
GUMPPIC 150 300 5177 //Bottom
GUMPPIC 250 300 5177 //Bottom
GUMPPIC 420 300 5178 //Bottom Right
resizepic 190 250 3600 190 22
TEXT 174 190 00154 0 //
TEXT 254 210 00154 1 //
//TEXTENTRY 200 251 190 20 4 0 2
TEXTENTRY 200 251 190 20 1152 0 2
BUTTON 290 287 242 243 1 0 0 //Cancel
BUTTON 360 287 249 248 1 0 1 //Cancel
[dialog d_password text]
What would you like to change
password to?
0
[dialog d_password button]
onbutton=0
SRC.SYSMESSAGE Cancelled
RETURN 1
//onbutton=1
//IF (STRMATCH( *=*, <ARGTXT[0]> )) || (STRMATCH( *PLEVEL*, <ARGTXT[0]> ))
//SRC.SYSMESSAGE Plevel Hack Doesnt Work Here.
//RETURN 1
//ELSE
//SRC.PASSWORD <ARGTXT[0]>
//RETURN 1
//ENDIF

onbutton=1
IF (STRMATCH( *=*, <ARGTXT[0]> ))
  SRC.SYSMESSAGE You may not include = in your password.
  RETURN 1
elif !(STRCMPI("","<ARGTXT[0]>"))  // thanks to Acratia for
  src.sysmessage You need to supply a password.
  return 1
elif (STRMATCH(*eof*,<ARGTXT[0]> ))
  src.sysmessage You cannot use eof in your password.
  return 1
elif (STRMATCH(*\n*,<ARGTXT[0]> ))
  src.sysmessage You cannot use \n in your password.
  return 1
elif (STRMATCH(*plevel*,<ARGTXT[0]> ))
  src.sysmessage You cannot use plevel in your password.
  return 1
elif (STRMATCH(<src.account.password>,<ARGTXT[0]> ))
  src.sysmessage Whats the point of changing your pass if you're going to use your old one?
  return 1
elif (STRMATCH(* *,<ARGTXT[0]> ))
  src.sysmessage Your password cannot have a space in it.
  return 1
elif (STRLEN(<ARGTXT[0]> ) > 15))
  src.sysmessage Password cannot be longer than 15 characters.
  return 1
elif (STRLEN(<ARGTXT[0]> ) < 4))
  src.sysmessage Password cannot be shorter than 4 characters.
  return 1

ELSE
SRC.PASSWORD <ARGTXT[0]>
RETURN 1
ENDIF

[EOF]
(This post was last modified: 05-06-2012 11:19 PM by Alias.)
05-06-2012 11:17 PM
Find all posts by this user Like Post Quote this message in a reply
RanXerox
Master
**

Posts: 550
Likes Given: 1
Likes Received: 12 in 9 posts
Joined: Dec 2010
Reputation: 19



Post: #2
RE: Use only letters or numbers ?
Perhaps try STRREGEX instead of STRMATCH...

Quote:STRREGEX(pattern, text) Returns 1 if text matches the specified regular expression pattern.

Something like this maybe:

Code:
STRREGEX("[0-9a-zA-Z]*", <ARGTXT[0]>)

Disclaimer... I didn't test this :-)
05-06-2012 11:29 PM
Find all posts by this user Like Post Quote this message in a reply
Alias
Journeyman
*

Posts: 107
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Apr 2012
Reputation: 0



Post: #3
RE: Use only letters or numbers ?
Did i do it as you think? becouse it all the time say "you cannot" even ir i write abcd
Code:
IF (STRREGEX("[0-9a-zA-Z]*", <ARGTXT[0]>))
SRC.PASSWORD <ARGTXT[0]>
return 1
ELSE
src.sysmessage You canot.
return 1
ENDIF
05-07-2012 12:01 AM
Find all posts by this user Like Post Quote this message in a reply
darksun84
Sir Spamalot
****

Posts: 1,687
Likes Given: 246
Likes Received: 162 in 151 posts
Joined: Mar 2012
Reputation: 35



Post: #4
RE: Use only letters or numbers ?
you have to remove the " "
05-07-2012 12:19 AM
Find all posts by this user Like Post Quote this message in a reply
Alias
Journeyman
*

Posts: 107
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Apr 2012
Reputation: 0



Post: #5
RE: Use only letters or numbers ?
still wont work Confused
05-07-2012 03:02 AM
Find all posts by this user Like Post Quote this message in a reply
Terrikate
Apprentice
*

Posts: 30
Likes Given: 1
Likes Received: 2 in 2 posts
Joined: Mar 2012
Reputation: 1

Ultima Alianza

Post: #6
RE: Use only letters or numbers ?
Code:
IF (STRREGEX(^[a-zA-Z0-9]+$, <ARGTXT[0]>))
05-07-2012 05:16 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Alias
Journeyman
*

Posts: 107
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Apr 2012
Reputation: 0



Post: #7
RE: Use only letters or numbers ?
(05-07-2012 05:16 AM)Terrikate Wrote:  
Code:
IF (STRREGEX(^[a-zA-Z0-9]+$, <ARGTXT[0]>))
Oh yeah, this is what i need!
TYVM! Wink
05-07-2012 07:11 PM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)