John D Groenveld wrote:
> In message <[EMAIL PROTECTED]>, Stas Bekman writes:
> 
>>If the logic has to be more flexible, you could get_handlers(), look at who's 
>>registered and then decide based on that whether to return OK or DECLINED?
> 
> 
> In Apache::AuthenDumb, how do I go from the CODE refs returned
> from $r->get_handlers('PerlAuthenHandler') to find whether I'm stacked
> between 'Apache::AuthenCache2::handler' and 
> 'Apache::AuthenCache2::manage_cache'?
> 
>     $r->log->debug("Apache::AuthenDumb: $user authenticated");
>     if (MP2) {
>        my @handlers = @{ $r->get_handlers('PerlAuthenHandler') || [] };
>        return (CACHE_SANDWICHED) ? Apache::DECLINED : Apache::OK;
>     }
>     else {
>        return Apache::Constants::OK;
>     }

it's hard for me to tell what you're trying to do, but I don't think you
need to do that.  the logic in AuthenCache really seems like it could be
boiled down to simply

if ($authenticated) {
  return OK
}
else {
  $r->push_handlers(PerlFixupHandler => \&manage_cache);
}

after all the encryption, case matching, and null password conditions are
checked.  this would eliminate the need for configuring the cache manager
specifically and still have the desired overall effect, leaving uses with only

  PerlAuthenHandler Apache::AuthenCache My::Authen::Handler

as an added bonus, if there is an earlier PerlAuthenHandler the RUN_FIRST
behavior will bypass AuthenCache altogether, so you don't need to check
whether you're after a PerlAuthenHandler or not.  similarly, if there is no
later PerlAuthenHandler to do the actual authenticaton, the authentication
process will default to Apache's authentication mechanism
(mod_auth/mod_authn_file) and likely fail due to the lack of a configured
.htpasswd file.

HTH

--Geoff

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html

Reply via email to