Author |
Topic |
|
redbrad0
Advanced Member
USA
3725 Posts |
Posted - 30 July 2001 : 15:55:59
|
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
|
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 |
|
|
RaiderUK
Average Member
United Kingdom
577 Posts |
Posted - 30 July 2001 : 19:31:25
|
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
|
|
|
redbrad0
Advanced Member
USA
3725 Posts |
Posted - 31 July 2001 : 01:56:36
|
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 |
|
|
RaiderUK
Average Member
United Kingdom
577 Posts |
Posted - 31 July 2001 : 05:16:42
|
you have put no text to compare in the inStr brackets
quote: if instr(1, "ABCDEFGHIJKLMNOPQRSTUVWXYZ") then
instr(1, "abcdefghjklmnpqrstuvwxyz", strPassword, vbTextCompare)
|
|
|
redbrad0
Advanced Member
USA
3725 Posts |
Posted - 31 July 2001 : 10:45:26
|
but isnt this line just comparing the first letter?
instr(1, "abcdefghjklmnpqrstuvwxyz", strPassword, vbTextCompare)
thats what the 1 is for right?
Brad |
|
|
davemaxwell
Access 2000 Support Moderator
USA
3020 Posts |
Posted - 31 July 2001 : 11:29:33
|
Nope. The 1, just tells it what position to start comparing from....
Dave Maxwell -------------- Proud to be a "World Class" Knucklehead |
|
|
redbrad0
Advanced Member
USA
3725 Posts |
Posted - 31 July 2001 : 12:18:48
|
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 |
|
|
|
Topic |
|