Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 how to tell if a string fits this critia
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

redbrad0
Advanced Member

USA
3725 Posts

Posted - 30 July 2001 :  15:55:59  Show Profile  Visit redbrad0's Homepage  Send redbrad0 an AOL message

The password must not be the same as the username
The password must not have been used before by the same user
The password must contain a minimum of 8 characters from at least 3 of the following 4 groups:


Group Characters

1. Alpha Upper: ABCDE, etc.
2. Alpha Lower: abcde, etc.
3. Numeric: 12345, etc.
4. Symbols: %*@!#, etc.


For example

myp@ssword is INVALID
MyPassword is INVALID
Myp@ssword is VALID
Mypassw0rd is VALID



Brad

Spoon
Average Member

Ireland
507 Posts

Posted - 30 July 2001 :  17:15:13  Show Profile  Visit Spoon's Homepage  Send Spoon an ICQ Message
1.The password must not be the same as the username
2.The password must not have been used before by the same user
3.The password must contain a minimum of 8 characters from at least 3 of the following 4 groups:

-----------
#1
-----------

If Request.Form("USERNAME") = Request.Form("PASSWORD") Then
ERRORCOUNT = 1
ERRORMESSAGE = "You username must not equal your password"
End If

============================
#2 is harder. Is the users passwords saved in the database. How are they referenced??? Its hard to tell you how to do this without the proper info, sorry. I can do it though, just post the info and ill help!


=============
#3
-------------

If Len(Request.Form("PASSWORD") < 8 Then
ERRORCOUNT = 1
ERRORMESSAGE = "Your password is too short. IT must be at least 8 characters long"
End If

The lasy bit is very complicated. Why do you want to do something like that? Its late here, ill take a better look at it tomorrow and see what i can come up with!

In the mean time, i need sleep




Regards - Spoon

Begineer? Need help installing the forums? - www.aslickpage.com/snitz_help.html

www.ASlickPage.com - Private Messaging
Go to Top of Page

RaiderUK
Average Member

United Kingdom
577 Posts

Posted - 30 July 2001 :  19:31:25  Show Profile  Send RaiderUK a Yahoo! Message
try this for the must be out of.


Dim strPassword
strPassword = Request.Form(password)

if len(strPassword) < 8 then
errorMsg = "The password must be at least 8 characters."
else
for i = 1 to len(strPassword)
if instr(1, "abcdefghjklmnpqrstuvwxyz", _
mid(strPassword,i,1), vbTextCompare) = 0 then
errorMsg = "you entered ilegal characters in your password."
exit for
end if
next
end if

Go to Top of Page

redbrad0
Advanced Member

USA
3725 Posts

Posted - 31 July 2001 :  01:56:36  Show Profile  Visit redbrad0's Homepage  Send redbrad0 an AOL message
The only one I am having a problem with is number 3, I can do the rest of this. This is just something that the admin's want done so im stuck with trying to do it.
What about something like this... Im not to sure about the instr function and if i used it right, but i would think this might work if i knew how to use it...



if len(strPassword) < 8 then
errorMsg = "The password must be at least 8 characters."
else
for i = 1 to len(strPassword)
if instr(1, "abcdefghjklmnpqrstuvwxyz") then
' # A LOWER CASE LETTER WAS USED
strLowerCaseUsed = 1
end if
if instr(1, "ABCDEFGHIJKLMNOPQRSTUVWXYZ") then
' # A UPPER CASE LETTER WAS USED
strUpperCaseUsed = 1
end if
if instr(1, "0123456789") then
' # A NUMBER WAS USED
strNumberUsed = 1
end if
if instr(1, "!@#$%^&*()") then
' # A SYMBOL WAS USED
strSymbolUsed = 1
end if

strTotalUsed = strLowerCaseUsed + strUpperCaseUsed + strNumberUsed + strSymbolUsed

if strTotalUsed<3 then
errorMsg = "You did not enter a legal password"
end if
next
end if



Brad
Go to Top of Page

RaiderUK
Average Member

United Kingdom
577 Posts

Posted - 31 July 2001 :  05:16:42  Show Profile  Send RaiderUK a Yahoo! Message
you have put no text to compare in the inStr brackets

quote:

if instr(1, "ABCDEFGHIJKLMNOPQRSTUVWXYZ") then



instr(1, "abcdefghjklmnpqrstuvwxyz", strPassword, vbTextCompare)

Go to Top of Page

redbrad0
Advanced Member

USA
3725 Posts

Posted - 31 July 2001 :  10:45:26  Show Profile  Visit redbrad0's Homepage  Send redbrad0 an AOL message
but isnt this line just comparing the first letter?

instr(1, "abcdefghjklmnpqrstuvwxyz", strPassword, vbTextCompare)

thats what the 1 is for right?

Brad
Go to Top of Page

davemaxwell
Access 2000 Support Moderator

USA
3020 Posts

Posted - 31 July 2001 :  11:29:33  Show Profile  Visit davemaxwell's Homepage  Send davemaxwell an AOL message  Send davemaxwell an ICQ Message  Send davemaxwell a Yahoo! Message
Nope. The 1, just tells it what position to start comparing from....

Dave Maxwell
--------------
Proud to be a "World Class" Knucklehead
Go to Top of Page

redbrad0
Advanced Member

USA
3725 Posts

Posted - 31 July 2001 :  12:18:48  Show Profile  Visit redbrad0's Homepage  Send redbrad0 an AOL message
how do you tell it to make sure the case is right? right now when i run the code below, it will say that a = A which it doesnt, a=a and A=A


if instr(1, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", strLineToCheck, vbTextCompare) then
' # A UPPER CASE LETTER WAS USED
strUpperCaseUsed = 1
end if


Brad
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.24 seconds. Powered By: Snitz Forums 2000 Version 3.4.07