[ic] IP address of user

Kevin Walsh interchange-users@interchange.redhat.com
Tue Apr 23 18:35:01 2002


> 
> I am trying to restrict the admin section of our catalog to specific local 
> ip address using the .access & .access_gate.
> 
> Here is what I have in the .access_gate file, but host will do a dns reverse 
> lookup to determine the domain (if not local), and I just need the ip 
> address. Any suggestions?
> 
> *: [if session host eq '196.168.11.11']Yes[else]No[/else][/if]
> 
Try creating a UserTag that looks something like this:

    UserTag remote_access Order addr
    UserTag remote_access Routine <<EOF
    sub {
        my $addr = shift or return 'No';
        return $CGI::remote_addr eq $addr ? 'Yes' : 'No';
    }
    EOF

Then use this instead of what you quoted:

    *: [remote_access addr="196.168.11.11"]

You could also modify the UserTag to treat the "ip" parameter
like a regex, allowing multiple IPs to be checked in one go.

-- 
   _/   _/  _/_/_/_/  _/    _/  _/_/_/  _/    _/
  _/_/_/   _/_/      _/    _/    _/    _/_/  _/   K e v i n   W a l s h
 _/ _/    _/          _/ _/     _/    _/  _/_/    kevin@cursor.biz
_/   _/  _/_/_/_/      _/    _/_/_/  _/    _/