On Sun, Feb 13, 2000 at 10:58:40AM -0800, Sean Chittenden wrote:
>       I'm assuming that you're doing this in an access handler.  If
> that's the case, set up some condition in your module where it figures out
> whether or not the user is authenticated.  If the user isn't
> authenticated:
> 
>       return(AUTH_REQUIRED);
> 
>       That should do it.  I don't think that'll return the error page
> stating that you need access to continue, instead that should pass a
> header (I think two actually) to the browser signaling it to prompt the
> user.
>       Another alternative would be to have the user redirected to a
> login page with good old fashion forms.  ;)  Good luck.  --SC

Yes this would be preferable, but I wanted to do this as a mod_perl
understanding exercise.

The required headers to trigger the browser login popup are:

$r->err_header_out('WWW-Authenticate', 'Basic realm="Base de données LNC"');
my ($res, $pw) = $r->get_basic_auth_pw;

and then check for $res and $pw to determine if the user has tried to login

>       PS  If you're really interested in details of this, check out:
> 
>       <http://www.modperl.com/book/chapters/ch6.html>

Excellent reference, many thanks for your help!

-- 
Louis-David Mitterrand - [EMAIL PROTECTED] - http://www.aparima.com

          **  Hello and Welcome to the Psychiatric Hotline **
 If you are paranoid-delusional, we know who you are and what you want
           - just stay on the line so we can trace the call.

Reply via email to