We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 3763
    • 155 Posts
    Hello @ all,

    This is the first module and the first plugin that I write for MODx grin

    The module is a simple banlist feature, where you can manage a list of IPs and email addresses that you want to ban from using your webpage (or whatever else you want). The email banlist is so far just as is, I haven’t altered the WebSignup snippet but you can do it.
    I’ve also wrote the plugin for preventing access to the homepage for visitors using a banned IP address.

    Screenshots

    How to install:
    • Extract the archieve and make sure it has at least two PHP files.
    • Create a new module called "Banlist" and add content of banlist.module.php file to it.
    • Run module and click for installation. This will create two new database tables and a new field to the existing system settings table.
    • Enable banning and start adding IP and email addresses.
    • In case you do not have a custom unauthorized page, create a new one and activate it from the managers system configuration settings.
    • Create a new plugin called "IPbanning" and add content of banip.plugin.php file to it, select the "OnWebPageInit" system event.
    • The plugin will block access of visitor with banned IPs to the homepage, to also block access to the manager simply activate the "OnBeforeManagerLogin" and "OnManagerPageInit" system events. I suggest you do so!

    I hope you’ll like it wink

    Boby
      ...my Photo Gallery on Flickr...
      • 18397
      • 3,250 Posts
      MARKSVIRTUALDESK Reply #2, 20 years ago
      Awesome! Great work!
        • 6726
        • 7,075 Posts
        Yeah this is another stone that will help us build MODx powered community websites, thanks !
          .: COO - Commerce Guys - Community Driven Innovation :.


          MODx est l'outil id
          • 7923
          • 4,213 Posts
          Great work Boby! Looks very good, Thanks!


            "He can have a lollipop any time he wants to. That's what it means to be a programmer."
            • 3763
            • 155 Posts
            Thank you guys for the comments laugh

            I hope somebody might find it useful, specially those who run great websites and are targeted by spambots. You can ban an entire IP range.

            Hope to find a nicer way to show the IP and email ban lists for a future version so you don’t have to scroll up and down through the whole page. Maybe add some tabs like almost all pages in the MODx manager, what do you think? Just need to figure out how MODx is doing it so I don’t need to write all the HTML/CSS stuff again.

            Boby
              ...my Photo Gallery on Flickr...
              • 15001
              • 697 Posts
              Thanks Boby,

              I installed your module on a localhost (127.0.0.1), for development purposes.
              It looks promising and I would like to test it by banning some IP address.
              I assume that banning the localhost 127.0.0.1 is not the best thing to do as I won’t be able to access MODx manager after that. I’ll most probably still be able to access the tables from phpMyAdmin but I don’t want to take that risk.

              Does someone know a way to emulate external IP adresses from a web browser ?
              My favorite ones are Opera and Firefox.

              Thanks.
                • 5570
                • 13 Posts
                Hi there, I’m an newbie to ModX. I did what you told in install.txt.

                But...

                How do I ’run’ the module (I saved it) and where do I insert the IP’s???

                thanks, coby

                --
                Run module and install it.