4.1. Controlling Access to Certain Pages
If the directory containing the page has a file .access and that file's size is zero bytes, access can be gated in one of several ways.
- If the file .access_gate is present, it will be read and scanned for page-based access. The file has the form:
page: condition *: condition
The page is the file name of the file to be controlled (the .html extension is optional). The condition is either a literal Yes/No or Interchange tags which would produce a Yes or No (1/0 work just fine, as do true/false).
The entry for * sets the default action if the page name is not found. If pages will be allowed by default, set it to 1 or Yes. If pages are to be denied by default in this directory, leave blank or set to No. Here is an example, for the directory controlled, having the following files:
-rw-rw-r-- 1 mike mike 0 Jan 8 14:19 .access -rw-rw-r-- 1 mike mike 185 Jan 8 16:00 .access_gate -rw-rw-r-- 1 mike mike 121 Jan 8 14:59 any.html -rw-rw-r-- 1 mike mike 104 Jan 8 14:19 bar.html -rw-rw-r-- 1 mike mike 104 Jan 8 14:19 baz.html -rw-rw-r-- 1 mike mike 104 Jan 8 14:19 foo.html
The contents of .access_gate:
foo.html: [if session username eq 'flycat'] Yes [/if] bar: [if session username eq 'flycat'] [or scratch allow_bar] Yes [/if] baz: yes *: [data session logged_in]
The page controlled/foo is only allowed for the logged-in user flycat.
The page controlled/bar is allowed for the logged-in user flycat, or if the scratch variable allow_bar is set to a non-blank, non-zero value.
The page controlled/baz is always allowed for display.
The page controlled/any (or any other page in the directory not named in .access_gate) will be allowed for any user logged in via UserDB.
- If the Variable MV_USERDB_REMOTE_USER is set (non-zero and non-blank), any user logged in via the UserDB feature will receive access to all pages in the directory. NOTE: If there is a .access_gate file, it overrides this.
- If the variables MV_USERDB_ACL_TABLE is set to a valid database identifier, the UserDB module can control access with simple ACL logic. See USER DATABASE. NOTE: If there is a .access_gate file, it overrides this. Also, if MV_USERDB_REMOTE_USER is set, this capability is not available.