Re: Protect Tag and Groups

This WebDNA talk-list message is from

1998


It keeps the original formatting.
numero = 15975
interpreted = N
texte = To make things simpler, here's how to make your own custom checking code that works with another database instead of the Users.db.1- Duplicate the Users.db and rename the new copy Custom.db. 2- Duplicate the MultiGroupChecker file and rename the new copy CustomChecker. 3- In your new CustomChecker file, change all the Users.db references to Custom.db. 4- Put both of these files in the same folder as the pages you want to protect.Now, wherever you want to protect a page based on the data in your new Custom.db, simply put:[include file=CustomChecker&groups=TESTING]at the top of the page. It will work just like the [protect] tags do, but with the Custom.db instead of the Users.db. >I studied the multigroupchecker. I get the include setup which will work >for what I want and, I will set it up separately as you suggest. But >part of the logic is still unclear to me. > >Part of multigroupchecker code is: > >[search >db=Users.db&groupsword=ww&wogroupsdatarq=[uppercase][groups][/uppercase]&eq >userdatarq=[uppercase][username][/uppercase]&eqpassdatarq=[uppercase][passw >ord][/uppercase]] > >[/search] > >You are taking the values from [password] and [username] and making them >part of the search criteria,Right.>but what about [groups]. Where did the >value come from inside [groups].It came from the [protect ] tag ... or from the groups= parameter in the new [include] tag you're going to use instead of the [protect] tag.>If you wanted to protect an ADMIN page say... wouldn't you change >[groups] to ADMIN ...No, you don't change the [groups] tag, you simply put ADMIN in the include tag that goes in your templates, like this:[include file=CustomChecker&groups=ADMIN]And if you're not using your own custom protection components, using:[protect ADMIN] does the same thing by referencing the Users.db.>How would I use this same kind of search to look for and list all the >groups to which a particular user is admitted?Listing all the groups is not the task of this code. If you want to see a list of what's in the groups field in the database, you can display that field just like any other field in any database. But remember, the [groups] field you're referring to above is NOT inside a [founditems] context, so it's not referring to a database field, it's referring to the value of the variable that is created when you use:[protect ]or[include file=CustomChecker&groups=]>When you edit the groups someone is a part of they need only be separated >by a space... correct?Yes that's correct.>This shows them listed in whatever groups are >listed each separated by spaces. ADMIN Group2 Group3.Right! In the groups field in the database, you must separate the group names by blank spaces ... but when you refer to more than one group in a protect tag, you must separate those group names with commas, not with spaces, like this:[protect ADMIN,STUDENTS,VENDORS]or when you're using your new Custom.db and CustomChecker file to do your page protection, it looks like this:[include file=CustomChecker&groups=ADMIN,STUDENTS,VENDORS]Sincerely, Ken Grome ken@iav.com 808-737-6499 WebDNA Solutions http://webdna.net/ Associated Messages, from the most recent to the oldest:

    
  1. Protect Tag and Groups (RH Prouty 1998)
  2. Re: Protect Tag and Groups (Grant Hulbert 1998)
  3. Re: Protect Tag and Groups (Kenneth Grome 1998)
  4. Protect Tag and Groups (RH Prouty 1998)
  5. Re: Fwd: Protect Tag and Groups (John Hill 1998)
  6. Fwd: Protect Tag and Groups (RH Prouty 1998)
To make things simpler, here's how to make your own custom checking code that works with another database instead of the Users.db.1- Duplicate the Users.db and rename the new copy Custom.db. 2- Duplicate the MultiGroupChecker file and rename the new copy CustomChecker. 3- In your new CustomChecker file, change all the Users.db references to Custom.db. 4- Put both of these files in the same folder as the pages you want to protect.Now, wherever you want to protect a page based on the data in your new Custom.db, simply put:[include file=CustomChecker&groups=TESTING]at the top of the page. It will work just like the [protect] tags do, but with the Custom.db instead of the Users.db. >I studied the multigroupchecker. I get the include setup which will work >for what I want and, I will set it up separately as you suggest. But >part of the logic is still unclear to me. > >Part of multigroupchecker code is: > >[search >db=Users.db&groupsword=ww&wogroupsdatarq=[uppercase][groups][/uppercase]&eq >userdatarq=[uppercase][username][/uppercase]&eqpassdatarq=[uppercase][passw >ord][/uppercase]] > >[/search] > >You are taking the values from [password] and [username] and making them >part of the search criteria,Right.>but what about [groups]. Where did the >value come from inside [groups].It came from the [protect ] tag ... or from the groups= parameter in the new [include] tag you're going to use instead of the [protect] tag.>If you wanted to protect an ADMIN page say... wouldn't you change >[groups] to ADMIN ...No, you don't change the [groups] tag, you simply put ADMIN in the include tag that goes in your templates, like this:[include file=CustomChecker&groups=ADMIN]And if you're not using your own custom protection components, using:[protect ADMIN] does the same thing by referencing the Users.db.>How would I use this same kind of search to look for and list all the >groups to which a particular user is admitted?Listing all the groups is not the task of this code. If you want to see a list of what's in the groups field in the database, you can display that field just like any other field in any database. But remember, the [groups] field you're referring to above is NOT inside a [founditems] context, so it's not referring to a database field, it's referring to the value of the variable that is created when you use:[protect ]or[include file=CustomChecker&groups=]>When you edit the groups someone is a part of they need only be separated >by a space... correct?Yes that's correct.>This shows them listed in whatever groups are >listed each separated by spaces. ADMIN Group2 Group3.Right! In the groups field in the database, you must separate the group names by blank spaces ... but when you refer to more than one group in a protect tag, you must separate those group names with commas, not with spaces, like this:[protect ADMIN,STUDENTS,VENDORS]or when you're using your new Custom.db and CustomChecker file to do your page protection, it looks like this:[include file=CustomChecker&groups=ADMIN,STUDENTS,VENDORS]Sincerely, Ken Grome ken@iav.com 808-737-6499 WebDNA Solutions http://webdna.net/ Kenneth Grome

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:

WebCat2 Append problem (B14Macacgi) (1997) Repeating Fields (1997) CGI Request Time Out (1997) Email (1998) WebCat with WebTen (1998) Performance Tuning (2006) Summing fields (1997) Webten + Webcat running smooth (1998) verify online (1997) Thanks ! (1997) Project 2 (1998) Searching for ALL / empty form field (1997) Setting up shop (1997) [WriteFile] problems (1997) New NT beta available (1997) Clickable maps and WebCatalog? (1996) Moment of Thanks (1997) 404 error page issue (2006) More on the email templates (1997) comma-delimited email (1998)