Plands.com Logo  Business Internet Services 
Main Menu
Home
Planetary CRM
  Benefits
  Features
  Demo
E-Mail Services
  E-mail Hosting
  Newsletters
  Discussion Lists
Web Hosting
Server Co-location
and Administration
Web Applications
Technical Support
Contact Us
DXP Samples
 
DxpHome  ||   Samples  ||   Details  ||   Docs  ||   Trees  ||   xml-xsl  ||   Links
// IpAccess.java

The IpAccess checks the IP that posted the request against it value stored in it's content section. If the value matches the value of the action attribute will determine what happens. See the two methods exec() and allowed() below.

This example uses it with an AuthUser tag. If action="allow" only the specified IP can will be accepted and others will be denied. If the action="deny" the specified IP will be denied but others will be allowed to proceed. Of course the next stage of authentication may still cause the request to be rejected.

  
 <dxp:AuthUser type="PW" lifespan="120" store="user">
   <dxp:IpAccess action="allow">192.168.1.25</dxp:IpAccess>
   <dxp:Resource priv="POST" resname="mycompany.timelog" />
</dxp:AuthUser>

In the next example the action="deny" so the specified IP address is denied and all others are allowed.

<dxp:IpAccess action="deny">208.160.205.57</dxp:IpAccess>

When the tag is not enclosed by a parent it can check a section of the page as it's running. In this situation is throws a SecurityException if the IP is not allowd. It's usually better to keep out unwanted IP addresses by using the tag inside a AuthUser tag because this is checked before the page is run.


@author Mark Ashworth
@version 0.1, 2001-04-20

Return to Index

Note: We have tried to test all of the code examples but they may contain errors. Any questions, comments, suggestions, or problems should be sent to info@plands.com.