#######################################################
#		Access Denied version 1.2
#
#  		Created by: Solution Scripts 
# 		Email: solutions@solutionscripts.com
#		Web: http://solutionscripts.com
#
#######################################################
#
#
# COPYRIGHT NOTICE:
#
# Copyright 2000 Solution Scripts  All Rights Reserved.
#
# This program is being distributed as freeware.  It may be used and
# modified free of charge, so long as this copyright notice, the header 
# above and all the footers in the program that give me credit remain 
# intact. Please also send me an email, and let me know 
# where you are using this script. 
#
# By using this program you agree to indemnify Solution Scripts from any liability.
#
# Selling the code for this program without prior written consent is
# expressly forbidden.  Obtain permission before redistributing this
# program over the Internet or in any other medium.  In all cases
# copyright and header must remain intact.
#
######################################################

Access Denied is a very simple .htpasswd manager.
Access Denied will work with any existing .htpasswd file, 
or any password file that has logins and crypted passwords 
seperated by :

Please note: Access Denied is only a password manager. It will not
protect the directory for you. It is likely you will have to set up
a .htaccess file in the directory you want protected. For details on
how to password protect a directory using this method, please visit:
http://faq.solutionscripts.com/misc/htaccess.html


As of version 1.1, Access Denied will manage as many password files
as you need under one script. 

Access Denied will also create the .htpasswd file for you if needed.......

To set Access Denied to the dir you want protected, the following
needs to be set for every password file:

$protect{'Dir Name'} = "/full_path_to/.htpasswd";

Where Dir Name is a the name or brief description of the passworded dir.
Leave the single quotes in. The Dir name must be unique from any other
dir names set in Access Denied. Inside the double quotes, you need to put the
full path to where the password file is, plus the file name..

Do this as many times for as many dirs as you want....

For example.....

$protect{'Dir 1'} = "/www/htdocs/dir1/.htpasswd";
$protect{'Dir 2'} = "/www/htdocs/dir2/.htpasswd";
$protect{'Dir 3'} = "/www/htdocs/dir2/.2htpasswd";

Then upload access.cgi and chmod it to 755 and the dir it is in to 777....

Call up access.cgi from your browser. You will be asked to set an admin password.
Once at the main screen, you have 3 options, a password is needed for all functions.

Adding a login -- to add a login, enter the login and password twice in the
appropriate text boxes, then select the dir to where it will be set, then
press the "Add Login" button to add the login to your password file.

Delete a login -- to delete a login, enter the login to delete in the login
text box, select the dir the login is in. Then click the "Delete Login"
button and the login will be deleted.

Delete Multiple -- Pressing the "Delete Multiple" button and select the dir
you want, will bring up a table of all logins set in that password file.
Each one will have a check box, check the box next to the logins you want
delete.

On the main screen there is a checkbox called rules. With this box
checked, certain rules are imposed when a login is created. When it is
unchecked, no rules are imposed. The rules that are imposed are as follows:

1. The login must be either only letters and/or numbers.
2. The login must be more than 3 characters and less than 12.
3. The login and password can not be the same.
4. The password must be either only letters and/or numbers.
5. The password must be more than 5 characters and less than 12.

A .htpasswd does not actually protect a directory. On apache servers you
must use a file name .htaccess file....

For more information on .htaccess files, visit the Access Denied F.A.Q.
at http://faq.solutionscripts.com/docs/accessdenied

Should you have any problems, post a message to our CGI Forum at
http://forum.solutionscripts.com/