Home: Perl Programming Help: Beginner:
Help!REMOTE_USER?



patyr
Deleted

Apr 12, 2000, 10:19 PM


Views: 889
Help!REMOTE_USER?

Firstly, sorry about my English...
How can I know if the authentification has been done? It's with "REMOTE_USER", isn't? Help me with the code, please!

Thanks,
Patricia


Cretep
User

Apr 13, 2000, 6:43 PM


Views: 889
Re: Help!REMOTE_USER?

Hi
Yes REMOTE_USER will carry the user name once they have been authenticated by .htaccess. Heres a little snippet of code that will see if the user was authenticated or not.

# If $ENV{'REMOTE_USER'} is empty there was no authentication
if ($ENV{'REMOTE_USER'} eq ""){
&no_access; #This will give the unauthenticated user a response by calling the subroutine no_access
}
# Elese if $ENV{'REMOTE_USER'} is full, call the subroutine access
else{
&access;
}

Regards
Peter Crouch


Cure
User

Apr 13, 2000, 11:32 PM


Views: 889
Re: Help!REMOTE_USER?

Hi

$ENV{'REMOTE_USER'} or $ENV{'AUTH_USER'}
will tell you if a user(s) have entered their username and password in a .htaccess

Example

if ($ENV{'REMOTE_USER'} or $ENV{'AUTH_USER'})
&go_away; #user has not been authentification
else{
&come_in; #user has been authentification
}


Cure