Announcement

Collapse
No announcement yet.

How to Setup a IP and Hostname Condition?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    How to Setup a IP and Hostname Condition?

    Hi all, we are trying to set up a condition as follows and was wondering the best way to set this up.

    If customer's IP = 10.1.10.1.1 OR 10.1.10.2 OR hostname = certainhost
    Do this...
    Else
    Do this...
    Endif

    I was hoping to maybe set up a variable to be set at TRUE or FALSE so that if we needed, we would have the capabilities to use where ever we wanted throughout the page.

    Any ideas on how I can accomplish this?
    Thanks

    #2
    Re: How to Setup a IP and Hostname Condition?

    host name is not very reliable world. to do remote address, use:

    <mvt:if expr="s.remote_addr EQ '123.123.123.132'">
    Bruce Golub
    Phosphor Media - "Your Success is our Business"

    Improve Your Customer Service | Get MORE Customers | Edit CSS/Javascript/HTML Easily | Make Your Site Faster | Get Indexed by Google | Free Modules | Follow Us on Facebook
    phosphormedia.com

    Comment


      #3
      Re: How to Setup a IP and Hostname Condition?

      The only problem with doing by IP only is, what if the person is on a dynamic IP ISP? The only way to know for sure would be get the hostname. Correct? or am I wrong.

      Comment


        #4
        Re: How to Setup a IP and Hostname Condition?

        Originally posted by Danielc1234 View Post
        The only problem with doing by IP only is, what if the person is on a dynamic IP ISP? The only way to know for sure would be get the hostname. Correct? or am I wrong.
        If they are on a dynamic IP, their hostname will change every time the IP changes as well, defeating the purpose of testing for the hostname. What you describe could only be really usable if the client IP was static.

        Comment


          #5
          Re: How to Setup a IP and Hostname Condition?

          Originally posted by Danielc1234 View Post
          The only problem with doing by IP only is, what if the person is on a dynamic IP ISP? The only way to know for sure would be get the hostname. Correct? or am I wrong.
          what Remik said...so its time to let us in on the secrete of "what you are trying to do" verse "how you are trying to do it"<g>
          Bruce Golub
          Phosphor Media - "Your Success is our Business"

          Improve Your Customer Service | Get MORE Customers | Edit CSS/Javascript/HTML Easily | Make Your Site Faster | Get Indexed by Google | Free Modules | Follow Us on Facebook
          phosphormedia.com

          Comment


            #6
            Re: How to Setup a IP and Hostname Condition?

            Test for multiple IP addresses comma separated.

            Code:
            <mvt:if expr="(s.Remote_Addr IN '10.1.10.1.1,10.1.10.2) OR (other condition)'">
            
            </mvt:if>
            I'm unclear on your other condition so a few possibilities are:

            incomming link: (s.HTTP_REFERRER EQ 'externaldomain.com')

            From your own domain: (s.HTTP_HOST EQ 'yourdomain.com')

            Restricted by browser type ('AppleWebKit' IN s.HTTP_USER_AGENT)
            Ray Yates
            "If I have seen further, it is by standing on the shoulders of giants."
            --- Sir Isaac Newton

            Comment


              #7
              Re: How to Setup a IP and Hostname Condition?

              Originally posted by Danielc1234 View Post
              The only problem with doing by IP only is, what if the person is on a dynamic IP ISP? The only way to know for sure would be get the hostname. Correct? or am I wrong.
              If you're working in a situation where you're at the level of using hostnames and IP addresses for filtering, then you're probably also at the level of looking into rDNS and such.

              hostnames can have multiple IP addresses assigned to them (this is where CDNs, caching, proxy servers, etc come into play), so rDNS is important here, because you want to make sure that you're not precluding an address because of a mismatch.

              Just a shot in the dark too, if you're company is example.com, their ISP may be Megapath.net, so their IP addresses aren't going to be anything like example.com, but they're going to be megapath.net IPs, from the Megapath IP block which was assigned to that company, whether it be static or dynamic.

              If you're leaning hard on IPs, you're in a sticky situation if you don't control them. The customer's network topology can change and they can switch from DHCP to static or from static to DHCP. They can change their routing in the NAT tables if someone changes from one division to another, or if there is other types of restructuring within the office.

              I'm not sure where you are at with your network administration, but from my personal experience, most IP address filtering comes in a few flavors for a few reasons.
              Geolocation (CDNs, Proxy Servers, relevant content, default language logic)
              Intranets (where you have "control" over IP addresses, and know what type of traffic you'll be receiving)
              Firewall Rules
              Web Application Services (subscription services, banking services [which are typically compounded with other finger-printing technologies], analytics, etc)

              If it is possible, and your customer is logged in, you may want to look into the option of putting them in 'availability groups'. This would make it more 'native' to Miva, with respect to giving an easy way to maintain the list. I don't think you want to copy and paste tons of IP addresses from page to page, and edit them all whenever one changes or not.

              ---

              If none of this is relevant, please disregard it, but hopefully it will save you some headaches.
              PCINET, LLC

              Miva Merchant Design, Development, Integration & Support
              We built the most Miva Merchant stores!
              Miva shopping cart design & integration service and our Portfolio!

              e-mail: [email protected]
              web: www.pcinet.com

              "We who cut mere stones must always be envisioning cathedrals."
              Quarry Worker's Creed

              Comment

              Working...
              X