Announcement

Collapse
No announcement yet.

Blocking IP Addresses

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

    #16
    Re: Blocking IP Addresses

    Originally posted by netblazon View Post
    Remik, does your solution allow/block access to the entire site? One of our mutual customers wants to hide pricing from international customers, but allow browsing of the site without pricing.

    I'm looking at MaxMind's other web service (GeoIP) which should be easy to modularize, but I thought I'd ask you first since they are already hosted with you.
    Let me know if you modularize it for store function purposes only. I have clients who want to display a message only to International Shoppers.

    Of course, one also uses MaxMind to block site loading from specific countries (as Remik explains).
    Best,
    Pamela

    Consultant / Developer / Trainer
    Contributing Editor to Practical Ecommerce
    Author of the Official Guides for Miva Merchant
    pamelahazelton.com

    Comment


      #17
      Re: Blocking IP Addresses

      Originally posted by dotCOM_host View Post
      Susan,

      The system I mentioned allows or blocks ALL access to/from the countries you specify. It's not a Miva module - doesn't know anything about Miva for that matter, it integrates directly within Apache and intercepts all web traffic.
      If the module in question can be used to invoke blocks of configuration conditionally instead of just refusing requests, I'd set a custom request header (mod_header, RequestHeader directive, I think) and use it in Miva to show or hide certain content. I have no idea, though, if Apache allows that kind of arbitrary conditionals - lighttpd does and I'm using them routinely with custom modules, passing their output to the actual application through request headers and/or environment variables.
      Remigiusz "Enleth" Marcinkiewicz

      Comment


        #18
        Re: Blocking IP Addresses

        I have finished the module. It performs a lookup through MaxMind's GeoIP service and sets it in a country variable, which can be accessed like this:

        Code:
        You are visiting from country: &mvt:ipcountry;<br />
        <mvt:if expr="l.settings:ipcountry EQ 'US'">
        	Welcome US visitor<br />
        <mvt:else>
        	Welcome International visitor<br />
        </mvt:if>
        So you could effectively use it for almost any purpose discussed - blocking prices, showing conditional content, blocking checkout, etc.

        I will have it ready for purchase tonight. You can get a test MaxMind account to try it out too. I'll post back when it's up!
        Susan Petracco
        NetBlazon

        1.866.400.2444

        _____________________________________________

        Like us on Facebook

        Comment


          #19
          Re: Blocking IP Addresses

          Now that is very cool.
          Thanks,

          Rick Wilson
          CEO
          Miva, Inc.
          [email protected]
          https://www.miva.com

          Comment


            #20
            Re: Blocking IP Addresses

            Thanks Rick! :) MaxMind has a great service going here.

            The module can be purchased at http://www.netblazon.com/p-NBCNTRYLU.html
            I don't have documentation ready, but basically you just assign the item "countrylookup" to any pages where you want to test what the customer's country is. Then you can use it in an if statement or print out the two-letter code based on the sample SMT here:

            Code:
            You are visiting from country: &mvt:ipcountry;<br />
            <mvt:if expr="l.settings:ipcountry EQ 'US'">
            	Welcome US visitor<br />
            <mvt:else>
            	Welcome International visitor<br />
            </mvt:if>
            I'll put it up on MivaCentral tonight (once I have a chance to make an image) and I'll post back here when I do, in case some of you prefer to purchase through there. I'll do the docs tomorrow.
            Last edited by netblazon; 06-13-11, 01:56 PM.
            Susan Petracco
            NetBlazon

            1.866.400.2444

            _____________________________________________

            Like us on Facebook

            Comment


              #21
              Re: Blocking IP Addresses

              I will put my money where my mouth is and buy it in the next day or so...I will probably need the documentation...but having me install it is a good way to "idiot proof" it since i am pretty unsophisticated when it comes to Miva...I will give you any feedback on it...I hope it does not cause an issue with the manual IP blocking module that I am currently using...since I don't want to turn that off yet...I see the criminal on my site all the time testing different IPs and don't want to give him/her a chance to run credit cards through....THANKS

              Comment


                #22
                Re: Blocking IP Addresses

                I am working on implementing this module...it uses if/else statements...if I want it to be: country a (nothing happens) else re-direct new page ....how do I do that? I tried to put in the standard refresh/redirect tag but it is ignoring the if/else statement?

                Comment


                  #23
                  Re: Blocking IP Addresses

                  Put this in the html profile tab at the beginning.

                  <mvt:item name="toolkit" param="callurl|geo|path to the free maxmind geo data/sample.php|POST|" />
                  <mvt:item name="toolkit" param="newsubstring|geocountry|g.geo,1,2" />
                  <mvt:if expr="g.geocountry AND (g.geocountry NE 'US')">
                  <mvt:item name="toolkit" param="sassign|emessage|Only USA customers can shop in this store" />
                  <mvt:item name="toolkit" param="vacreate|error_message|g.emessage|," />
                  <mvt:item name="toolkit" param="sassign|Error_Message_Count|1" />
                  <mvt:item name="toolkit" param="vassign|Error_Messages|l.all_settings:error _message" />
                  <mvt:item name="toolkit" param="render|MNTN" />
                  <mvt:item name="toolkit" param="exit" />
                  </mvt:if>

                  Then for every page you want to hide, simply assign the toolkit item to that page's items list. The one page you would never assign it to is the MNTN (store maintenance page). By not assigning the toolkit to the page, the tokens are not run. For those pages that do run it, it will retrieve the country code from maxmind data, then test the condition. In the above it only allows US customers to view the page.
                  Last edited by wcw; 06-23-11, 07:33 AM.
                  Bill Weiland - Emporium Plus http://www.emporiumplus.com/store.mvc
                  Online Documentation http://www.emporiumplus.com/tk3/v3/doc.htm
                  Question http://www.emporiumplus.com/mivamodu...vc?Screen=SPTS
                  Facebook http://www.facebook.com/EmporiumPlus
                  Twitter http://twitter.com/emporiumplus

                  Comment

                  Working...
                  X