Thread View: pl.comp.lang.perl
2 messages
2 total messages
Started by Kurt
Sun, 20 Jul 1997 22:26
password protecting a directory
Author: Kurt
Date: Sun, 20 Jul 1997 22:26
Date: Sun, 20 Jul 1997 22:26
44 lines
2717 bytes
2717 bytes
The questions I have here are not earth shattering by any means. What I describe here is in use throughout the internet. Nevertheless, it is still beyond my understanding on how they work. I am working hard to understand them but come to a roadblock and seek help. In the spirit of Perl and the many flavors of Unix (freely distributed) I am posting this message. Is there anyway to password protect a directory of webpages with Perl? I know that you can do it with .htacess and so forth. The only drawback that I can see with this is that, although one can protect a directory, it is limited to the use of 'one' password for the directory. Here is what I am after: 1. A user 'registers' themselves on a webpage, providing, amongst other things, a 'username' and 'password' 2. This info is written to a file with Perl, in one of many possible formats. 3. The user enters the 'password protected' area and is prompted to enter a 'valid user name' and a 'valid password'. Only those individuals that present a valid username and password gain entrance into the site. The usernames and passwords are unique to the individual. I have seen how .htaccess works. I understand that it protects the directory and all the files in that directory. BUT, the problem, as I have mentioned, is that there is ONLY one password. I am unaware, but very interested, in any way around this. For instance, is there any way to have a registration page that utilizes a scripting language, such as Perl, write the usernames and passwords to the .htpasswd file so that every time the directory is accessed and .htacess is invoked that .htpasswd can be scanned through to see if the user entered a valid username and password. Some other questions on issues that are baffling me: 1. In Javascript one can use the 'onLoad( ) function to invoke an action. Is there anyway to do this with Perl? From what I understand the only way to invoke a Perl program is through the use of a form. The only exception I see this to this is the <#exec .....> piece of code I sometimes see (but I have only seen this with logging stat scripts. Thank You, Kurt
Re: password protecting a directory
Author: Michal Mosiewicz
Date: Mon, 21 Jul 1997 17:57
Date: Mon, 21 Jul 1997 17:57
24 lines
1587 bytes
1587 bytes
Kurt wrote: >[...] > Is there anyway to password protect a directory of webpages with Perl? I > know that you can do it with .htacess and so forth. The only drawback > that I can see with this is that, although one can protect a directory, > it is limited to the use of 'one' password for the directory. That is not true. You may use AuthUserFile with many user/password entries. You may add this entries using a perl program if you wish. The format is very simple. Also, if you use apache you may use mod_perl to write a customised perl authoriser. > 1. In Javascript one can use the 'onLoad( ) function to invoke an > action. Is there anyway to do this with Perl? Javascript is run on the client side. Currently, it is not possible (yet?) for perl. Mike -- ******** MEMBER OF THE INTERNATIONAL PROGRAMMERS GUILD ******** WWW: http://www.lodz.pdi.net/~mimo tel: Int. Acc. Code + 48 42 148340 add: Michal Mosiewicz * Bugaj 66 m.54 * 95-200 Pabianice * POLAND
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads