We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 26439
    • 104 Posts
    I have a guestbook based on the "usercomments" snippet, which three people use. Unfortunately one of those three is a spambot who posts at least three times a day a link to, well you don’t want to know.

    So yesterday I was doing the regular cleanout and when I had finished there was new spam. In short I now have it’s IP address.

    So is there an easy way to ban an IP from posting in the guestbook?

    *waits for the "you should upgrade to..." comment* ( also appreciated )
      • 25663 MODX Staff
      • 12,272 Posts
      Upgrade to Jot, which has moderation features built in. smiley
        Ryan Thrash, MODX Co-Founder
        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
        • 33372
        • 1,611 Posts
        You probably should upgrade to Jot. As should I. My personal website is so old that I’m constantly amazed it still works...

        So if you’re like me and you’re just looking for a patch to get you through to that mythical time when you’ll have plenty of time to upgrade everything and do a complete redesign, here’s a useful line of code to add to your snippet:

        if($_SERVER['REMOTE_ADDR']=='127.0.0.1') die('You\'ve darkened my door for the last time, you lousy spambot!');


        It’s a bit drastic, but it will do the trick. You could just add the if statement to the posting part of your form processing if you don’t want to shut everything down. Replace 127.0.0.1 with the bad guy’s IP, of course.
          "Things are not what they appear to be; nor are they otherwise." - Buddha

          "Well, gee, Buddha - that wasn't very helpful..." - ZAP

          Useful MODx links: documentation | wiki | forum guidelines | bugs & requests | info you should include with your post | commercial support options
          • 26439
          • 104 Posts
          Excellent Zap, I added that word for word, and will be updating to Jot as soon as I’ve, er, updated to 0.9.5

          "You’ve darkened my door for the last time, you lousy spambot!"

          *chuckles*
            • 33337
            • 3,975 Posts
            I am sure someone developed a module to manage IP banning stuff here, but cant find it .. sad

            Got it! http://modxcms.com/forums/index.php/topic,6945.0.html but this shouldn’t hold you from upgrading! tongue
              Zaigham R - MODX Professional | Skype | Email | Twitter

              Digging the interwebs for #MODX gems and bringing it to you. modx.link
              • 33337
              • 3,975 Posts
              There is one more:

              http://www.frozenminds.com/spamblacklist.html

              Never tried both myself, but have fun wink.

              regards.
                Zaigham R - MODX Professional | Skype | Email | Twitter

                Digging the interwebs for #MODX gems and bringing it to you. modx.link