IP Blocker for Zen Cart v1.5.0 through v1.5.5

Version 2.1.3 by lat9

Current Support Thread at Zen Cart Forums: http://www.zen-cart.com/showthread.php?211251-IP-Blocker-1-5-1

Version History:

What it does

IP Blocker allows you to block accesses to your store, based on the IP address of the access. Once you've copied the plugin's files to your store, use your Zen Cart admin's Tools->IP Blocker to specify the list of addresses. There are two blocks of IP addresses that you specify:

  1. Blocked IP Addresses. An IP address that falls in one of the ranges specified here is redirected to your store's /special_login.php script. If the IP Blocker password is correctly entered on that login screen, that IP address is allowed access for that session's duration.
  2. Allowed IP Addresses. Use this IP address list to provide a list of exceptions to the blocked list above. If an IP address falls into one of the ranges specified here, access is allowed to your store even though the address also falls into a blocked address range.

The tool allows you to specify:

A modification is also provided to your admin's Tools->Who's Online, presenting a link entitled Block this IP next to each IP address if the IP Blocker is enabled. Clicking that link will result in the associated IP address being added to the Blocked IP Addresses list.

Note: Starting with v2.1.0, the tool stores only the IP address format used by the store-side processing to conserve database space. The displayed version of the blocked and allowed address lists are computed for the admin-console display.

Installation

There are core-file overwrites in this plugin; you should always backup your cart's database and files prior to making any changes. Once you have unzipped the plugin's distribution file:

  1. Rename the /YOUR_ADMIN directory to match your Zen Cart admin directory's name.
  2. Copy the plugin's files to your Zen Cart's file system:
    1. /special_login.php
    2. /includes/auto_loaders/config.ip_blocker.php
    3. /includes/extra_datafiles/ip_blocker_database_tables.php
    4. /includes/init_includes/init_ip_blocker.php
    5. /YOUR_ADMIN/ip_blocker.php
    6. /YOUR_ADMIN/whos_online.php
    7. /YOUR_ADMIN/includes/auto_loaders/config.ip_blocker_admin.php
    8. /YOUR_ADMIN/includes/extra_datafiles/ip_blocker_database_tables.php
    9. /YOUR_ADMIN/includes/extra_datafiles/ip_blocker_filenames.php
    10. /YOUR_ADMIN/includes/functions/extra_functions/ip_blocker_functions.php
    11. /YOUR_ADMIN/includes/init_includes/init_ip_blocker.php
    12. /YOUR_ADMIN/includes/languages/english/ip_blocker.php
    13. /YOUR_ADMIN/includes/languates/english/extra_definitions/ip_blocker.php

Removing the IP Blocker

To remove the IP Blocker tool from your Zen Cart:

  1. Delete the files that you copied during the plugin's installation.
  2. Run the /ip_blocker_uninstall.sql using your Zen Cart's Tools->Install SQL Patches.