Hi There,
I read the following thread (with Geoff's comment in there too):
http://www.gossamer-threads.com/archive/mod_perl_C1/docs-dev_F5/a_little_feedback_P38941/
than I thought about Geoff's advice about using PerlAccess Handler and
came
up with this concoction (which works :-) )

Conf entry:
<Location /~xyz>
AuthName someauth
AuthType someauth
PerlAccessHandler Apache::MyModule
PerlAuthenHandler Apache::SuperAuthen
PerlAuthzHandler Apache::Xdoc
require valid-user
</Location>
------------------------------------------
package Apache::SuperAuthen;

use Apache::Constants qw(:common);
use Apache::Registry ();
use Apache::InHouseModule;
use Apache::MyModule;

sub handler {
        my $r = shift;
        if (Apache::MyModule::handler($r) == OK ||
        Apache::InHouseModule::handler($r) == OK){
                return OK;
        }

return AUTH_REQUIRED;
}
1;
__END__
-------------------------------------------------------
However, I would be please if someone can explain what actually happens. I
dont "clearly" understand why it works :--)

Thanks,

Shashank.

On Fri, 30 May 2003, Geoffrey Young wrote:

>
> > When http://www.abc.com/~xyz gets called PerlAuthenHandler MyModule is
> > invoked. MyModule code checks for IP after reading a file from xyz
> > directory.
> > If the host ip matches with the one in the file, it returns OK and the
> > PerlAuthzHandler never gets called and the webpage is served to the user.
>
> you may want to try using a PerlAccessHander for checking the IP, then
> combine that with Satisfy Any (as opposed to the Satisfy All default).
>
> HTH
>
> --Geoff
>

Reply via email to