Technical References - [protect]

numero = 184
interpreted = N
texte = [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. [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...

Tips and Tricks

A list of user-submitted tips ...

Download WebDNA Applications

WebDNA applications...

F.A.Q

A compilation of some user's questions...

Technical Change History

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

Related Readings:

[lastautonumber]

displays the last auto-generated number...

[authenticate]

WebDNA provides a few options for password protecting your pages...

[grep]

Replaces text based on a regular expression...

[session]

[session] is a new WebDNA feature that recognises a browser through its "fingerprint"...

[text]

Text variables are fundamental building blocks of the WebDNA language...

[username]

Using [password] and [username] is an easy was to show the browser login dialog box...