perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Philip M. Gollucci" <pgollu...@p6m7g8.com>
Subject PerlAuthenHandler question
Date Fri, 06 Jan 2006 17:29:38 GMT
Hi,

I've setup a AAA using the 3 handlers.  I took a small amount from the 
mod_perl Cookbook, to figure out how to do it using an HTML form instead 
of a REALM popup box.

So the good news is it works.

Here's the config:
         ### AAA
         <Location /timeline>
             AuthType Basic
             AuthName "ISST"
             Require valid-user

             PerlAccessHandler ISST::Access
             PerlAuthenHandler ISST::Authen
             PerlAuthzHandler ISST::Authz
         </Location>

Here's the ISST:Authen code  --- See the commented question in it.  Thanks!

sub handler {
     my $r = shift;

     my $user = ISST::User->getLoggedIn($r);

     ## IS THIS CORRECT ?
     ## can't used DECLINED or you get the REALM popup
     return Apache2::Const::OK if $r->uri =~
	m#/timeline/(login|logout|register|privacy)#;

     if ($user) {
         return Apache2::Const::OK;
     }
     else {
         $r->note_basic_auth_failure;
         $r->headers_out->set(Location => ISST::Const::URL_LOGIN);
         return Apache2::Const::REDIRECT;
     }
}


-- 
------------------------------------------------------------------------
"Love is not the one you can picture yourself marrying,
but the one you can't picture the rest of your life without."

"It takes a minute to have a crush on someone, an hour to like someone,
and a day to love someone, but it takes a lifetime to forget someone..."

"I wanna hold ya till I die ... I wanna hold ya till the fear in me 
subsides."

Philip M. Gollucci (pgollucci@p6m7g8.com) 301.254.5198
Consultant / http://p6m7g8.net/Resume/resume.shtml
Senior Software Engineer - TicketMaster - http://ticketmaster.com
1024D/A79997FA F357 0FDD 2301 6296 690F  6A47 D55A 7172 A799 97F

Mime
View raw message