common:authorizedRemoteAddress

This lets you control access to content based on users IP-address/range/hostname.

Parameters

Name Required Default Type Description
Parameters
 id true   Object/String The result variable name.
trustedIPs true   Object/String A regexp of trusted IP:s.
allowDnsLookupForIPs false   Boolean Use dns lookup to ensure non-fakeip:s
trustedDomains false   Object/String A commaseparated list of trusted domains
         

Examples

This example checks if the user comes from IP-range. A great tip is to use the service at http://www.google.com/support/analytics/bin/answer.py?hl=en&answer=55572 to generate a regexp. 

<common:authorizedRemoteAddress id=”isValidIP” trutedIPs=”^63\.212\.171\.([1-9]|[1-9][0-9]|1([0-9][0-9])|2([0-4][0-9]|5[0-4]))$”/>
<c:choose>
    <c:when test=”${isValidIP}”>
        You can watch this very valuable information ☺
    </c:when>
    <c:otherwise>
        No – no access for you…
    </c:otherwise>
</c:choose>



comments powered by Disqus