PrestaShop Forum

The best place in the world to ask questions about PrestaShop and get advice from our passionate community!

PrestaShop Forum

Jump to content

[Module] Multi Ip-Range Blocker

6 replies to this topic
#1
Trip

    PrestaShop Apprentice

  • Members
  • PipPip
  • 153 posts
Module developed by Jing-Shop
This modules blocks a range of IP-addresses and redirects requests from them to another side.

Tested with PS 1.1

Quick Setup
1) Unzip & upload to your modules directory
2) Edit the ip-ranges you want to block in the ips.txt in the module directory.
3) Edit
header("Location: http://www.example.com");
at the bottom of ipblock.php to the page the visitor or bot should be redirected to.
4) Install this module through Prestashop Back Office

So I don't know if someone really needs this but the module allows you easily to block ip-ranges from your shop.
So you can block tax and revenue offices :), spambots or even whole countries from accessing your site.
Important:
The format of the addresses must be like:
58.136.0.0 58.136.255.255
58.137.0.0 58.137.255.255
58.147.0.0 58.147.127.255

Every single range is one line.
NO hyphen, comments or whatever should be in the ips.txt
This module only blocks IP-ranges, not single IP's so be carefull.


If you like what I am doing (and it is working for you) buy a pants from the shop :)
post a link on your homepage, blog or whatever, follow us on twitter ;) or just say thank you to the prestateam for giving us a nice piece of software.
When you look in the code you know it is not a cakewalk to develop this (<-- I mean the prestashop code :) ).
Regards, trip

Attached Files



#2
jhnstcks

    PrestaShop Fanatic

  • Moderators
  • 1913 posts
If you wanted to to block a single ip couldnt you just define the range as 58.136.0.0 58.136.0.0
Helpful hints and tips to Empower your Prestashop site - Join us on Facebook and get involved, tell us the things that help you.
If you think someone's answer helped, please give him/her a Positive Reputation vote by liking their post.
E-commerce hosting from Scotserve, fast, reliable and affordable.

#3
plouise

    PrestaShop Apprentice

  • Members
  • PipPip
  • 49 posts
Thanks Trip.
I'm not security specialist, so I don't know if this module give the same level of security as the htaccess.

Some may answer?

And also, anybody have a ip database of knowed hacking place?
Great product, I will share the benefits.
version 1.2.2

#4
Trip

    PrestaShop Apprentice

  • Members
  • PipPip
  • 153 posts
Hi all,
I think my my script is more secure because from what I read about the function that determines the real ip is, it should be able to find it out
even if the user is using a proxy server.
That's what I read. I haven't tested it. From my point of view .htaccess should be faster but I think no one will notice a performance reduction with my script unless you maybe have a high traffic shop with lots of visitors.
I think my solution is a little bit more comfortable and targeted to unexperienced users.
A database with bad neighbourhood would be nice. Maybe someone finds something cool and than I would think about to modify the parser and maybe add a cron script to download the ip's once a day.
Regards, trip

#5
Ehinarr

    Sir

  • Members
  • PipPipPipPip
  • 1134 posts
Great job! Thanks for shrare it!
My Blog
PS v1.4.7.0

#6
ezkudo

    PrestaShop Newbie

  • Members
  • Pip
  • 3 posts
I can't install this module.
Could you explain to me step by step please.?
I'm new for prestashop.

#7
Vilas

    PrestaShop Apprentice

  • Members
  • PipPip
  • 365 posts
Hi,

How to get customer IP who are sending us query through contact form?

Thanks
Vilas