- verify.pl is a Perl script that automates adding users to a .htaccess and .htpasswd password control scheme. The user initiates the authorization request by filling out a CGI form submitting his name and e-mail address. If there is a list of approved users, the userís name is checked against that list before access is granted. If the user is among the list of approved users, or if everybody is allowed access, then a random password is generated and sent to the user at the specified e-mail address. A user name is also generated for the user from the e-mail address.
This script is written to be used with the .htaccess access control scheme using ODBM database, but can be modified to use the regular version of .htaccess and .htpasswd fairly readily.
- You have to have access to a web server to run this script. The web server would preferably be running any variant of UNIX, such as Linux or BSD. (NT web servers with Perl interpreter can be used, but youíre on your own!) You must have the capability to execute CGI scripts (check with your ISP to make sure). And you must possess a working knowledge of the UNIX file system, HTML coding, and how to implement a CGI script.
- verify.pl uses the cgi-lib.pl module, which was written by Steven E. Brenner. cgi-lib.pl is usually loaded with the standard Perl implementation. However, if itís not available on your server, you can download your own copy of cgi-lib.pl from the cgi-lib.pl Home Page.
- Obtain a copy of the script using one of the options below.
- Install verify.pl in your cgi-bin directory. You may have to rename the script to verify.cgi depending on the configuration of your server software. Set the permissions of verify.pl or verify.cgi to world-readable and executable (0755).
- Edit verify.pl or verify.cgi to reflect your situation. Pay particular attention to the Perl interpreter location (first line) and the path to sendmail specified in $mailprog. If these variables are not set correctly, your script will not work.
- Create a link to verify.pl or verify.cgi on a web page such as <a href="http://www.isp.com/yourname/cgi-bin/verify.cgi">. When the user selects that link, the form is built automatically.
Get the script file: