|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
User Authentication and Individual Directories
I am wondering if there are any tutorials/canned scripts on the following issue:
I would like to use a user/pass login form that would both authenticate a user and place them into his or her own private directory on the web server. The server is running Apache 1.3.14, perl v5.005_03, PHP v4, and MySQL. I have tried other "canned" scripts but they dump all the users into one generic "member's area". I'd like each user to have their own directory. I am new to programming and am trying to learn... but reading thru code and trying to figure out what does what is a little overwhelming. Thank you for any advice/suggestions! |
|
#2
|
|||
|
|||
|
Big,
There are many approaches to this problem. Here are a couple that come to mind. 1. Use the htaccess method to authenticate users. Using this approach, after the user authenticates, you can watch for the environment variable $ENV{'REMOTE_USER'} from any cgi script to catch the username. Then, you can open their directory according to their username. EX. ... $userpath = "/path/to/directory/$ENV{'REMOTE_USER'}"; open (FILE, "$userpath/file_to_open"); ... 2. Use a text file to hold username and passwords and directory info (if the directory locations don't follow a pattern). Apply the same logic from above like so... A. Authenticate user against character delimited file. B. Set $userpath equal to value in file for the matched user's "home" directory. I hope this helps. If you require more detail or specific blocks of code, please let me know what you will be trying to accomplish and any other details you can offer. Bob |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Perl Programming > User Authentication and Individual Directories |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|