Hi, all.

I am trying to figure out a way to set a PerlAuthenHandler (using
$r->push_handlers()) from a PerlInitHandler.

Here is what I have so far:

<Location /test>
    PerlInitHandler Test::Init
</Location>

package Test::Init;
sub handler {
    my $r = shift;

    #
    # First try: gave me errors, so I swicthed to the method below
    # "[error]Usage: Apache::auth_type(r) at /apache/lib/Test/Init.pm line 30."
    #$r->auth_type('Basic');
    #$r->auth_name('Test');
    #$r->requires([{requirement => 'valid-user',method_mask => -1}]);

    # These give me no errors in the error log
    Apache::auth_type('Basic');
    Apache::auth_name('BGEP')
    Apache::requires([{requirement => 'valid-user',method_mask => -1}]);

    $r->push_handlers(PerlAuthenHandler => \&auth);

    return OK;
}

...and I get nothing useful. &auth is not being called (it returns OK and
prints to STDERR).

Setting the AuthName, AuthType, and requires in the httpd.conf, with a
PerlAuthenHandler of Test::Init::auth, works just fine, so the problem
seems to be with the setting of these through &handler.

My setup is Apache 1.3.12, mod_perl 1.23, Perl 5.6.0 (all built from source,
with mod_perl compiled staticly) on Linux 2.2.14.

Any ideas?

darren

-- 
UNIX is a process that runs under Emacs.

Reply via email to