Re: WebCat2 - Getting to the browser's username/password data
This WebDNA talk-list message is from 1997
It keeps the original formatting.
numero = 10272
interpreted = N
texte = >>Q: How do I get a form to look at the *browser's* username/password data>>instead of the database's username/password data when the form is a results>>template? Wouldn't any [username] or [password] tags in that form pull that>>data from the database instead of from the browser's data?>>Could be a problem, but maybe this will help:>>----template----->[username] <--this comes from Browser's username (password dialog)>>[foundItems]>[username] <--this comes from database field [username] (if there is such>a field)>[/foundItems]>>[username] <--this comes from Browser's username (password dialog)Okay, I understand this so far. It's as I expected, because I understandthe concept of contexts in getting the data from the right location.Since there's no way to keep users from deleting all the data in aparticular database file without having at least *some* data in the[username] and [password] fields, I am definitely going to have a[username] and [password] field in *all* my .db files from now on, whetheror not I actually need them for anything else.Therefore, if I want the [username] to come from the browser, I have tomake sure the [username] tag is located outside my [founditems] contexts.>Context is important here: inside a [foundItems] it will look for database>fieldnames first before looking for Browser information. Anything outside>a [foundItems] will not look for database fields, because there is no>database container at that point. The depth of nesting determines where>it looks for [xxx] tags, always looking out each level until it finds>something with the right name.>>[search db1]> [foundItems]> [xxx] <-- fieldnames from db1> [search db2]> [foundItems]> [xxx] <-- fieldnames from db2, but if no match, then look out to db1> [date] <--hmm. if db2 has [date], then use that. If not, then>out to db1's [date],> <--if not, then out to Form's [date], if not, then use>today's date from server> [/foundItems]> [/search]> [/foundItems]>[/search]>>If absolutely no matches are found (for [fred], let's say), then literally>put [fred] into the text, because it's assumed you meant to put those>literal characters into your HTML.I have two questions about the example above:1- What is the Form's [date] you mentioned above? Do you mean the valueof a variable named date that this form would have picked up from thetemplate or link that led to this page? If that's not what you meant,please explain this to me ... :)2- Aparently the only way right now for WebCat2 to get the [username] and[password] data from the browser (instead of from the database) whileinside a [founditems] context is to create variables while *outside* of a[founditems] context ... such as v.browserUsername=[username] andv.browserPassword=[password], then do something like this in thefollowing template:[founditems][xxx] <-- (data available for everyone to see) [showif [v.browserUsername]=[lookupdb=agents.db&&value=[v.browserUsername]&lookInField=username&returnField=username¬Found=] [showif [v.browserPassword]=[lookupdb=agents.db&&value=[v.browserPassword]&lookInField=password&returnField=password¬Found=] [xxx] <-- (data available only to agents with a username & password inthe agents.db) [/showif ] [/showif ][/founditems]If this works, I would use the above html in the listingResults.tmpl file,because it is the listing data I must display in two different versions. Mygoal here is to display public listing data to everyone, and to displayadditional private listing data only to those people who have a valid[username] and [password] in the agents.db. I just have to use[authenticate] to make sure the visitor is actually someone with a valid[username] and [password] in the agents.db firstI think this html would make WebCat2 compare the browser's [username] and[password] values with the agents.db's [username] and [password] values todetermine whether or not to show the agent-only data, right?General Question 1: Is there any limit to the number of nested[showif][hideif] contexts?General Question 2: Is there anything NetCloak can do that WebCat2 cannot?General question 3: Is it possible to have more than one [founditems]context in a template when they are *not* nested?Sincerely,Ken
Associated Messages, from the most recent to the oldest:
>>Q: How do I get a form to look at the *browser's* username/password data>>instead of the database's username/password data when the form is a results>>template? Wouldn't any
[username] or
[password] tags in that form pull that>>data from the database instead of from the browser's data?>>Could be a problem, but maybe this will help:>>----template----->
[username] <--this comes from Browser's username (password dialog)>>
[founditems]>
[username] <--this comes from database field
[username] (if there is such>a field)>[/foundItems]>>
[username] <--this comes from Browser's username (password dialog)Okay, I understand this so far. It's as I expected, because I understandthe concept of contexts in getting the data from the right location.Since there's no way to keep users from deleting all the data in aparticular database file without having at least *some* data in the
[username] and
[password] fields, I am definitely going to have a
[username] and
[password] field in *all* my .db files from now on, whetheror not I actually need them for anything else.Therefore, if I want the
[username] to come from the browser, I have tomake sure the
[username] tag is located outside my
[founditems] contexts.>Context is important here: inside a
[founditems] it will look for database>fieldnames first before looking for Browser information. Anything outside>a
[founditems] will not look for database fields, because there is no>database container at that point. The depth of nesting determines where>it looks for [xxx] tags, always looking out each level until it finds>something with the right name.>>[search db1]>
[founditems]> [xxx] <-- fieldnames from db1> [search db2]>
[founditems]> [xxx] <-- fieldnames from db2, but if no match, then look out to db1>
[date] <--hmm. if db2 has
[date], then use that. If not, then>out to db1's
[date],> <--if not, then out to Form's
[date], if not, then use>today's date from server> [/foundItems]> [/search]> [/foundItems]>[/search]>>If absolutely no matches are found (for [fred], let's say), then literally>put [fred] into the text, because it's assumed you meant to put those>literal characters into your HTML.I have two questions about the example above:1- What is the Form's
[date] you mentioned above? Do you mean the valueof a variable named date that this form would have picked up from thetemplate or link that led to this page? If that's not what you meant,please explain this to me ... :)2- Aparently the only way right now for WebCat2 to get the
[username] and
[password] data from the browser (instead of from the database) whileinside a
[founditems] context is to create variables while *outside* of a
[founditems] context ... such as v.browserUsername=
[username] andv.browserPassword=
[password], then do something like this in thefollowing template:
[founditems][xxx] <-- (data available for everyone to see) [showif [v.browserUsername]=[lookupdb=agents.db&&value=[v.browserUsername]&lookInField=username&returnField=username¬Found=] [showif [v.browserPassword]=[lookupdb=agents.db&&value=[v.browserPassword]&lookInField=password&returnField=password¬Found=] [xxx] <-- (data available only to agents with a username & password inthe agents.db) [/showif ] [/showif ][/founditems]If this works, I would use the above html in the listingResults.tmpl file,because it is the listing data I must display in two different versions. Mygoal here is to display public listing data to everyone, and to displayadditional private listing data only to those people who have a valid
[username] and
[password] in the agents.db. I just have to use
[authenticate] to make sure the visitor is actually someone with a valid
[username] and
[password] in the agents.db firstI think this html would make WebCat2 compare the browser's
[username] and
[password] values with the agents.db's
[username] and
[password] values todetermine whether or not to show the agent-only data, right?General Question 1: Is there any limit to the number of nested
[showif][hideif] contexts?General Question 2: Is there anything NetCloak can do that WebCat2 cannot?General question 3: Is it possible to have more than one
[founditems]context in a template when they are *not* nested?Sincerely,Ken
Kenneth Grome (by way of Grant Hulbert)
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:
Configuration Q (1998)
Retirement (2000)
Repeating Fields (1997)
Setting up shop (1997)
Formating Tables w/[founditems] (1998)
SetHeader (1997)
Large Database Options? (1999)
Questions! (2000)
WebCat2b13MacPlugin - nested [xxx] contexts (1997)
Test (2006)
too many nested tags ... (1997)
quantity minimum problem (1997)
Setting up shop (1997)
RE: TeaRoom (1997)
WCS Newbie question (1997)
Separate SSL Server (1997)
how many users (2000)
Repost: Upload file limits (2000)
Execute Applescript (1997)
oops private message leaked into talk list (1997)