Password-Secure Database
'One-minute Epiphanies' is a sample password-secure database written in
Perl. Visitors can only enter the site after logging on
(establishing a new account first if necessary).
Successfully logged-on members can browse and modify a database of
'epiphanies', or terse little nuggets of wisdom.
On the technical side, the site is cool because
-
it's entirely password-secure.
-
it's all accessed through a central script, which minimizes security risks.
-
all pages inside the site are requested through the secure script.
-
the script processes outgoing requested pages, automatically substituting
out literal links for appropriate calls back to the script.
-
the content of the site is customized for each user.
-
authorized users can add entries to the database, or remove entries which
they own.
-
authorized users can vote on other users' entries, thereby modifying them.
-
authorized users can generate a report of all their database entries.
-
authorized users can generate a report of the most popular users.
In addition, the site is an experiment in building a reputation-based online
community similar to those developed by eBay and Amazon.com, except without
the commercial slant.
Want to see the code? Here it is:
epiphany.pl
is the main script through which the entire site is accessed.
login.pl
provides routines for verifying logins and establishing new accounts.
pages.pl
provides a simple call for fetching pages and customizing their content.
epiphdb.pl
handles reading from and writing to the epiphany and user databases.
epiphmain.html
is an example of what an unparsed html file from the site looks like.
To see how the substitution works, enter
the site and view the source for the main page. You'll notice
that the links are different, and that the pages.pl routine has substituted
out the special tag
<!--epiphany username -->
for your username.
Thanks to Peter D. Kovacs for his publicly-available cookie-lib.pl library,
of which I have availed myself in the construction of this database.
Thanks as well to Steven E. Brenner, creator of the ubiquitous cgi-lib.pl.
|