CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: Intermediate:
RE: passwords and security



Jun 7, 2000, 2:21 PM

Post #1 of 3 (1360 views)
RE: passwords and security Can't Post

Dear Perl Gurus,

I am trying to implement a password gate on my site (Apache server) that simply directs the user to a protected page based on their username and password. The protected page may contain further links to other protected pages that the user should be able to freely retrieve (i.e. should only have to enter username and password once). This is very common on the internet and is similar to logging into a site like Yahoo which then sends you to your MyYahoo homepage. The htaccess per-directory authorization scheme doesn't do the job because it only protects directories, it does not route a particular user to a particular page.

Any tips/resources you can suggest would be greatly appreciated.

Thank you,

Mark Sorensen


Jun 15, 2000, 8:26 AM

Post #2 of 3 (1360 views)
Re: RE: passwords and security [In reply to] Can't Post

And your Perl question is ?



Jun 15, 2000, 8:48 AM

Post #3 of 3 (1360 views)
Re: RE: passwords and security [In reply to] Can't Post

If you couple .htaccess with a CGI that pretends to be a directory, you could do something like ...

<BLOCKQUOTE><font size="1" face="Arial,Helvetica,sans serif">code:</font><HR>

# Proper security measures and
# error handling left as an
# exercise for the reader. :-)

my $files = "/path/to/user/files";
my $user = $ENV{'REMOTE_USER'};
my $path = $ENV{'PATH_INFO'};
if ( open( FILE, "$files/$user/$path" ) ) {
print "Content-Type: text/html\n\n",
} else {
die "Couldn't open $user/$path: $!";

Anyhoo, that's a very simplistic example, but should seed some ideas.

Alternately, you can take a look at mod_rewrite, but you should seek an Apache forum for more assistance with that.


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives