Re: Setting an auth realm dynamically

2001-06-19 Thread Doug MacEachern

On Fri, 15 Jun 2001, Rodney Broom wrote:

> I (like everybody else) have a site that is wholy dynamically
> generated. As such, I can't alway set an auth realm in the config or in
> .htaccess. What I'd like to do is an access handler like this: 
 
> sub handler {
> my $r = shift;
> if ($r->uri =~ m/$some_magic_pattern/|) {
> $r->auth_name($custom_realm);
> $r->auth_type('Basic');

those two should work.

> $r->dir_config('require valid-user');

this will not.  $r->requires could be made writable, but i worry about
getting used to that since it will not work with threaded-2.0 without
changes to apache.





Setting an auth realm dynamically

2001-06-15 Thread Rodney Broom



I (like everybody else) have a site that is wholy 
dynamically generated. As such, I can't alway set an auth realm in the config or 
in .htaccess. What I'd like to do is an access handler like this:
 
sub handler {    my $r = 
shift;    if ($r->uri =~ 
m/$some_magic_pattern/|) {    
$r->auth_name($custom_realm);    
$r->auth_type('Basic');    
$r->dir_config('require valid-user');
 
    return 
'OK';    }    return DECLINED;
}
 
Obviously these routines don't work this way... Any 
thoughts?
 
---Rodney BroomProgrammer: 
Desert.Net