Zot-Dispatch allows each file to which data is going to be appended to have
its own password file. The name of the password file is the same as the name
of the append file with .zda as an extension. If a file
exists with this name for any file to which data is being appended, append
authorization will take place. If the file does not exist, then appending
will take place as usual. This file contains three types of information:
#)
separated fields. A username, a password, and two fields
which can be used to hold other information about the user.
ZD-Relfects (except default response
reflects).
ZD-Reflects.
#) signs as
follows:
usernameUsername#password#zda-var-1#zda-var-2
Password
The password field can contain either an encrypted password or an
unencrypted password. If the first character of the password entry is an
equals (=) sign then the password is considered unencrypted
(the equals sign is not considered part of the password). Otherwise the
password is considered encrypted using the same algorithm as the C crypt
library function.
ZDA-Var-1 and ZDA-Var-2
ZDA-Var-1 and ZDA-Var-2 are the third and fourth fields of a
password entry, respectively. They can contain any information desired. If
a user is successfully authorized for append, these two values will be placed
in variables capable of being substituted by using ZDA-Var-1 and
ZDA-Var-2. One use of these fields could be storing information
about users so that when they append, information about the authorized user
can be included.
Example Password Lines:
lmegliol#afrctaq6ONht2#Leonard Megliola#http://www.oac.uci.edu/indiv/lmegliol/ juser#=example-password#Joe User#http://www.someplace.net/The first line has the username set as lmegliol, the password is encrypted, and the third and fourth fields contain my real name and homepage URL, respectively.
The second line has the username set to juser, the password is unencrypted and set to "example-password", and the third and fourth fields contain his real name and homepage URL, respectively.
Remember, if lmegliol or juser are successfully authorized, the values
of the third and fourth fields will be placed into variables named
ZDA-Var-1 and ZDA-Var-2 and can be substituted into
templates.
ZD-Reflect (or there is only a ZD-Reflect which
returns the default response). The success template is specified on its own
line in the password file as:
SUCCESS=Success Template
Where Success Template is either a file reference to a template or a URL
to a template document. In either case they are specified the same as is done
in the Template field of a ZD-Method variable. The only
difference is that there can be no body: template specified
here.
Examples:
SUCCESS=file:/templates/template.1
orSUCCESS=http://www.oac.uci.edu/templates/template.1
ZD-Reflects exist. The
fail template is specified in the password file as:
FAIL=Fail Template
Where Fail Template is either a file reference or a URL as in the
success template above.
Examples:
This is useful for explaining to a unauthorized user that they have been denied.FAIL=file:/templates/template.1
orFAIL=http://www.oac.uci.edu/templates/template.1
ZD-User and
ZD-PasswordTwo new Zot-Dispatch input elements are introduced here to aid in the append authorization
ZD-User and ZD-Password:
ZD-User
ZD-User is the username entered in a form by a person
wishing to append to a file.
ZD-Password
ZD-Password is the password that they enter
to verify their identity (the form element should be of the type
password).
ZD-User element will be searched for within
the password file that is associated with an append file. If found, the value
of the ZD-Password element will be checked with the password
associated with the username. If there is a match between the two, the append
will take place.
Regardless of the success or failure of an authorization, the value of
ZD-User can be substituted into a template, while for security
reasons, the value for ZD-Password can never be substituted.
ZD-All to mean that anyone can append.
If there is any user named ZD-All, then all users who fail to
provide valid usernames and passwords will be allowed to append. The values
of ZDA-Var-1 and ZDA-Var-2 will be set to the
values in the third and fourth fields of the ZD-All line. If a
user is successfully authorized with their own username and password, then
their own third and fourth fields will be used for ZDA-Var-1 and
ZDA-Var-2.
ZD-Appends are executed before ZD-Mails which
are executed before ZD-Reflects.
If more than one ZD-Append is being executed, then only the
values for ZDA-Var-1 and ZDA-Var-2 from the last
ZD-Append will be left when executing the other
ZD-Methods.
If any append access authorizations fail then the fail template will
be returned. Keep in mind, though, that there may appends that already did
succeed. One situation where an append will succeed with one file and fail
with another is if the two .zda files vary with regards to the
user who is attempting the append. One solution of getting around this is
creating a single .zda file and using hard links. This assures
that they all have the same data.
.zda file:
FAIL=file:/indiv/lmegliol/cgi-src/ZD/zd-2.0-docs/ZD-2.0-Unauthorized.html
SUCCESS=http://www.oac.uci.edu/indiv/lmegliol/cgi-src/ZD/zd-2.0-docs/ZD-2.0-Success.html
user1#=password#User Number 1#unencrypted
user2#52lMw8K6okfFg#User Number 2#encrypted
Both passwords are "password".
Enter in a username below and a password (not necessarily a valid
combination) below and press the Authorize Append button below.
lmegliol@uci.edu)