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 understand the 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 a particular 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, whether or not I actually need them for anything else.Therefore, if I want the [username] to come from the browser, I have to make 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 value of a variable named date that this form would have picked up from the template 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) while inside a [founditems] context is to create variables while *outside* of a [founditems] context ... such as v.browserUsername=[username] and v.browserPassword=[password], then do something like this in the following template:[founditems] [xxx] <-- (data available for everyone to see) [showif [v.browserUsername]=[lookup db=agents.db&&value=[v.browserUsername]&lookInField=username&returnField=usernam e¬Found=] [showif [v.browserPassword]=[lookup db=agents.db&&value=[v.browserPassword]&lookInField=password&returnField=passwor d¬Found=] [xxx] <-- (data available only to agents with a username & password in the 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. My goal here is to display public listing data to everyone, and to display additional 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 to determine 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:

    
  1. Re: WebCat2 - Getting to the browser's username/password data (Kenneth Grome 1997)
  2. Re: WebCat2 - Getting to the browser's username/password data (Grant Hulbert 1997)
  3. Re: WebCat2 - Getting to the browser's username/password data (Kenneth Grome 1997)
  4. Re: WebCat2 - Getting to the browser's username/password data (Grant Hulbert 1997)
  5. Re: WebCat2 - Getting to the browser's username/password data (Kenneth Grome (by way of Grant Hulbert) 1997)
>>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 understand the 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 a particular 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, whether or not I actually need them for anything else.Therefore, if I want the [username] to come from the browser, I have to make 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 value of a variable named date that this form would have picked up from the template 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) while inside a [founditems] context is to create variables while *outside* of a [founditems] context ... such as v.browserUsername=[username] and v.browserPassword=[password], then do something like this in the following template:[founditems] [xxx] <-- (data available for everyone to see) [showif [v.browserUsername]=[lookup db=agents.db&&value=[v.browserUsername]&lookInField=username&returnField=usernam e¬Found=] [showif [v.browserPassword]=[lookup db=agents.db&&value=[v.browserPassword]&lookInField=password&returnField=passwor d¬Found=] [xxx] <-- (data available only to agents with a username & password in the 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. My goal here is to display public listing data to everyone, and to display additional 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 to determine 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:

[FoundItems] Image Gallery (2001) Where has WebDNA shown up in your life? (2003) searching multiple databases (1997) user submitted data REPOST (2000) [WriteFile] problems (1997) Mozilla/4. and Browser Info.txt (1997) [WebDNA] WebDNA 8.6 announced - New features (2018) flushdatabases (1997) webcat-sys (1998) Separate SSL Server (1997) OT: SMSI stock (2003) Re2: AAgghh!! Help, please. SSL strikes again. (1997) Directory Overload (1998) b12 cannot limit records returned and more. (1997) 3.0 [TEXT] variables (1998) Re[2]: Monthly Reports (2000) Help name our technology! (1997) WebCatalog Plug-in for Webstar. (1997) WC2.0 Memory Requirements (1997) Product Comparison (2000)