Technical References - [protect]

[protect] and [authenticate]
These two tags will throw up the browser's authentication box. The difference between the two is that the [protect] tag ties in directly to the built-in Users.db in your WebDNA admin area, whereas the [authenticate] tag is meant for developers who prefer to 'roll their own', such as if you have your own user database with more extensive fields and functionality than the simple users.db.

[protect groups]
Putting [Protect groups] in your template causes the user's browser to display the Username/Password dialog until the visitor enters a username/password belonging to one of the specified groups. The Users.db database provided with WebDNA contains the fields user, pass, groups, expire_date and expire_del. It does not contain any other information like name, address, and so forth, so it is primarily useful when you have admin pages that need to be accessed by specific users. (If you are building a site with a membership database, you would create your own login scheme with [authenticate].)

Users.db
You can add users to the Users.db in the WebDNA administration area, under the Security section. The Admin group has built-in privileges to get into your WebDNA preferences, so create new groups for other users to use on their own pages. Only use group Admin for people needing to configure your WebDNA settings. I.e., just because some users will function as an admin within their own sections, you WON'T make them part of the official Admin group. You can create a new group when you add or edit a user. In other words, there is no special "create group" button. A user can be a member of several groups; just list them in the group textbox for that user.

After you have users with groups created, you can use the [protect] tag on any page. You can add mulitiple groups. For instance, you might put [protect clientA,admin] (or [protect groups=clientA,admin]). This gives a clientA member authority to access. But it also gives you authority to access, without having to add "clientA" to your own list of groups. (It does NOT somehow confer admin status to anyone in clientA group.)

Be careful how you name your groups. The code that checks the User.db looks for whole words to match the group. If you name your groups something that could be misconstrued as two separate words, such as ABC_treasurer, ABC_membership and you also have a group simply ABC, then the first two will be seen by WebDNA as belonging to ABC, because the underscore is read as a delimiter. Other problematic delimiters are dashes, spaces and periods. If you have a similar scheme to organize your groups, make sure there is no ambiguity as in the above example.

Directory Protection
You cannot protect directories with WebDNA, because the webserver does not return any processing data to WebDNA is a directory listing is requested, so if you think you're going to protect say, a directory of images, the answer is no. You need to control this with something like an .htpasswords file, or realm protection on a server level. Terry Wilson

DOWNLOAD WEBDNA NOW!

Top Articles:

WebDNA Modules

A list of the currently available modules...

WebDNA Libraries

A list of available libraries for WebDNA...

Technical Change History

This Technical Change History provides a reverse chronological list of WebDNA changes...

WebDNA reference

A list of all WebDNA instructions...

Download WebDNA Applications

WebDNA applications...

F.A.Q

A compilation of some user's questions...

Related Readings:

[url]

[url]...

[xsl]

Enables the WebDNA programmer to compile and apply XSL style sheets to XML data...

[flushcache]

...

[clearlineitems]

Remove all line items from the specified shopping cart...

[capitalize]

Capitalizes the first letter of all words in a sentence...

[JSONstore]

[JSONstore] stores a multidimentional JSON object into a WebDNA database...