Click to See Complete Forum and Search --> : dynamically adding users to protected directory


pastorharry
02-16-2007, 09:53 AM
hi,

i am relatively new to running a 'members only' type site. We essencally have placed content in a password protected directory.

at this point we are faced with a dilema. How do i dynamically add some one to the list of people allowed to access the protected directory.

what we do is present a page that asks for a subscription donation on sucessfully making the payment we would like to automatically add the persons name and password to the access file.

is there some script to do this?

also.. is there a way to have more then one 'password' protected directory or different levels of access. (Ie:junior, regular, premium members).

ray326
02-16-2007, 11:07 PM
If it's an Apache server then you can use a program called htpasswd to update the password file.

pastorharry
02-17-2007, 03:19 PM
how do i call the program dynamically. i mean if i could some how get the user name into a varable, and their password in anoghther how do i call the htaccess (function/program) from within a web. i thought perhaps php had such a function built in. it would seem such a typical thing one would want to do.

ray326
02-17-2007, 11:52 PM
Here's a Perl module that could be called through CGI to do the job.

http://search.cpan.org/~mono/PWD-PwBasic-0.13/PwBasic.pm