General information
Category:
Coding, syntax & commands
Checking # of upper() makes small sense if you count # of lower, but don't include in criteria or check.
Adding more special characters might alsohelp, but there you have to be careful to consider devices used for entering - from touch screens with different special chars to keyboards for other languages. Dash and backslash probably as well used for URI and dirs, so include - perhaps also Space(). And brackets enlarge the # of codes by 8 (subsuming HTML "brackets" for brevity) a hacker has to include - and at least there I'd insist on 2 different special chars. Eliminating used special char from string to check against allows easy coding, if you really want to go that way.
If already on topic - not all use latin letters, but for vfp apps not a too far out assumption. But if considering web or web service enabling....
regards
thomas
>Howdy all,
>
>Attempting to evaluate a user password as they are setting up their accounts for the first time to ensure it meets the following criteria:
>
>at least 2 uppder case letters
>at least 2 special characters
>at least 2 numbers
>must be atleast 8 characters but no more than 15.
>
>I have my user entry form setup with red round shapes that i cam changing the colors to green as the user is entering in their desired password. As it meets the syntax criteria in the text box i would like for those colors to change from red to green. The code is being placed in the interactive change section . But unfortnately it is not happening. The code is below. Hopefully someone smarter than I can assist figuring it out. I considered putting the code in a For Endfor loop within the Interactive change event of the text box.
>
>m.lcChar = Substr(this.value,1)
>
> Do Case
> Case m.lcChar $ "!@#$%^&*_-+=':;.,"
> oVar.punctuation = oVar.punctuation + 1
>
> IF oVar.punctuation => 2
> ThisForm.Pw1_Shape_2spec.BackColor = RGB(0,255,0)
> ELSE
> ThisForm.Pw1_Shape_2spec.BackColor = RGB(163,5,29)
> ENDIF
>
> Case Isalpha(m.lcChar)
> If Isupper(m.lcChar)
> oVAr.upCase = oVAr.upCase + 1
>
> IF oVar.UpCase >= 2
> ThisForm.Pw1_Shape_2cap.BackColor = RGB(0,255,0)
> ELSE
> ThisForm.Pw1_Shape_2cap.BackColor = RGB(163,5,29)
> endif
> Else
> oVar.LowCase = oVar.LowCase + 1
> Endif
>
> Case Isdigit(m.lcChar)
> oVar.digit = oVar.digit + 1
>
> IF Ovar.Digit >= 2
> ThisForm.Pw1_Shape_2numb.BackColor = RGB(0,255,0)
> ELSE
> ThisForm.Pw1_Shape_2numb.BackColor = RGB(163,5,29)
> ENDIF
>
> CASE m.lcChar >= 8
> IF m.lcChar >= 8
> ThisForm.Pw1_Shape_8.BackColor = RGB(0,255,0)
> ELSE
> ThisForm.Pw1_Shape_8.BackColor = RGB(163,5,29)
> endif
>
> Endcase
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only