Re: User Authentication
This WebDNA talk-list message is from 2003
It keeps the original formatting.
numero = 54522
interpreted = N
texte = On 11/27/03 9:11 AM, "Alan White"
wrote:I see where you are going with this but a couple of things:Here is an alternative (based on the fields being called u_username &u_password)A couple of points. I did this with hide and show ifs... Just my preference.You can convert to if thens if you choose.You don't need to compare and test the username because it is used as thesearch string... Hence there would be no match if it wasn't alreadyqualified.Second, I did a search as I am setting 3 VARS so it is just easier for methan 3 lookups. And I set them to default values first.I added a line for checking for duplicates... Which WILL mess you up downthe road. Trust me on that.I just wrote this quickly so I may have missed something, but I think thelogic is sound.:-) HTHAlex[text]U_usernameVAR=0[/text][text]U_passwordVAR=0[/text][text]U_AccessLevelVAR=0[/text][search db=admin/users.db&eqU_usernameDATArq=[_username]][showif [numfound]>1]Something here because you have more than 1 identicalU_username field[/showif][showif [numfound]=0] No matches for username... Send them back to loginform[/showif][founditems][text]U_usernameVAR=[U_username][/text][text]U_passwordVAR=[U_password][/text][text]U_AccessLevelVAR=[U_accesslevel][/text][/founditems][/search][showif [url][U_passwordVAR][/url]=[url][_password][/url]]Password matches... Now just check against security level forcontent[/showif][hideif [url][U_passwordVAR][/url]=[url][_password][/url]]Password failed... Send them back to the login form[/hideif]> [text]checkName=[lookup> db=admin/users.db&value=[_userName]&lookinfield=userName&returnfield=userNam> e][/text]> [if "[_userName]"="[checkName]"]> [then]> [text]checkPass=[lookup> db=admin/users.db&value=[_userName]&lookinfield=userName&returnfield=passwor> d][/text]> [if ("[_userName]"="[checkName]") & ("[_password]"="[checkPass]")> [then]> [lookup > db=admin/users.db&value=[_userName]&lookinfield=userName&returnfield=accessL> evel]> [redirect> url=https://www.hanon-shop.com/press/press.html?accessLevel=[accessLevel]]> [/then] > [else]> [redirect> url=https://www.hanon-shop.com/press/index.html?error=2]> [/else]> [/if]> [redirect url=https://www.hanon-shop.com/press/press.html]> [/then]> [else]> [redirect url=https://www.hanon-shop.com/press/index.html?error=1]> [/else]> [/if]Alex J McCombie New World MediaChief Information Officer Box 124888/892.6379 MartVille, NY 13111Alex@NewWorldMedia.com http://OurClients.comInterface Designer WebDNA Programmer Database Designer-------------------------------------------------------------This message is sent to you because you are subscribed to the mailing list .To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/
Associated Messages, from the most recent to the oldest:
On 11/27/03 9:11 AM, "Alan White" wrote:I see where you are going with this but a couple of things:Here is an alternative (based on the fields being called u_username &u_password)A couple of points. I did this with hide and show ifs... Just my preference.You can convert to if thens if you choose.You don't need to compare and test the username because it is used as thesearch string... Hence there would be no match if it wasn't alreadyqualified.Second, I did a search as I am setting 3 VARS so it is just easier for methan 3 lookups. And I set them to default values first.I added a line for checking for duplicates... Which WILL mess you up downthe road. Trust me on that.I just wrote this quickly so I may have missed something, but I think thelogic is sound.:-) HTHAlex[text]U_usernameVAR=0[/text][text]U_passwordVAR=0[/text][text]U_AccessLevelVAR=0[/text][search db=admin/users.db&eqU_usernameDATArq=[_username]][showif [numfound]>1]Something here because you have more than 1 identicalU_username field[/showif][showif [numfound]=0] No matches for username... Send them back to loginform[/showif][founditems][text]U_usernameVAR=[U_username][/text][text]U_passwordVAR=[U_password][/text][text]U_AccessLevelVAR=[U_accesslevel][/text][/founditems][/search][showif [url][U_passwordVAR][/url]=[url][_password][/url]]Password matches... Now just check against security level forcontent[/showif][hideif [url][U_passwordVAR][/url]=[url][_password][/url]]Password failed... Send them back to the login form[/hideif]> [text]checkName=[lookup> db=admin/users.db&value=[_userName]&lookinfield=userName&returnfield=userNam> e][/text]> [if "[_userName]"="[checkName]"]> [then]> [text]checkPass=[lookup> db=admin/users.db&value=[_userName]&lookinfield=userName&returnfield=passwor> d][/text]> [if ("[_userName]"="[checkName]") & ("[_password]"="[checkPass]")> [then]> [lookup > db=admin/users.db&value=[_userName]&lookinfield=userName&returnfield=accessL> evel]> [redirect> url=https://www.hanon-shop.com/press/press.html?accessLevel=[accessLevel]]> [/then] > [else]> [redirect> url=https://www.hanon-shop.com/press/index.html?error=2]> [/else]> [/if]> [redirect url=https://www.hanon-shop.com/press/press.html]> [/then]> [else]> [redirect url=https://www.hanon-shop.com/press/index.html?error=1]> [/else]> [/if]Alex J McCombie New World MediaChief Information Officer Box 124888/892.6379 MartVille, NY 13111Alex@NewWorldMedia.com http://OurClients.comInterface Designer WebDNA Programmer Database Designer-------------------------------------------------------------This message is sent to you because you are subscribed to the mailing list .To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/
Alex McCombie
DOWNLOAD WEBDNA NOW!
Top Articles:
Talk List
The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...
Related Readings:
NT Version on IIS 4.0 (1997)
PSC recommends what date format yr 2000??? (1997)
Thanks for tips, more quest (1997)
WebCatalog2 Feature Feedback (1996)
Kill the webcat process (2000)
Webcat causing crashes left and right! (1997)
Bug Report, maybe (1997)
My solution... (1996)
CGI Request Time Out (1997)
Image maps/Webcat (1997)
(thx) automating a POST (2002)
Secure server question (1997)
[WebDNA] SCOPE:, ---- was:--- Date: header on emails - timezone problem perhaps (emai)
weird G3 happenings (1998)
AD Error Msg (1997)
Cookie set browser session. (1998)
form data submission gets truncated (1997)
Only charge card when product shipped ? (1997)
Shopping problems with 2.1b3 acgi (1997)
macosx 1 process, linux N processes, macosx chokes under load (2001)