Greetings,
I have password-protected a directory, via .htaccess. (Actually my provider’s control panel did that part behind the scenes.) Once a person has typed in their username and password to access the protected directory, the index.html page calls a Perl script which needs to know who is using it.
Is there any way the Perl script can see which .htaccess “user” requested the page that called it? Otherwise, I have to make the person log in twice: once to get into the directory, and another via log-in code I have to include in the script.
In my server logs, when there is a page request for a page that lives in a protected directory, it shows the “user” name in the output. But when I do a dump of $ENV variables using this code in a test script (called by a form on a page in the protected directory):
foreach (sort keys %ENV) {
print “$_ = $ENV{$
}
the name of the user (in this case, me) is not in any of the variables. Is this because the script itself lives in cgi-bin, and not the password-protected directory?
Is there any way I can make the protected-directory log-in procedure do double duty?
Thanks!
DM