At times, you may find it necessary to block or ban specific IP addresses from visiting your store. You may want to block people using an IP address if they have placed a fraudulent order or they may have left abusive or negative comments on your website. OpenCart 1.5.x has the ability to ban IP addresses from your website but this option is currently under review. This article provides information on blocking IP addresses through the cPanel and the .htaccess file. You can also more specifically allow customer accounts using the OpenCart Administrator dashboard interface. The steps to enable or disable customers will be listed below.
Blocking IP addresses in the cPanel
IP addresses can be blocked at the server level using the cPanel interface. This allows the server to handle the security instead of the OpenCart application. The .htaccess file allows you to handle large numbers of IP addresses directly instead of using the IP deny manager which allows you add them only one at a time. The video and written tutorial to block IP addresses can be seen here: Restricting access with IP Deny and .htaccess.
Enabling or Disabling Customers in the OpenCart Dashboard
- Log into your OpenCart Admin Dashboard.
- Hover over the menu bar where it is labeled Sales.
- Scroll down, then click on Customers. When the menu pops up to the right, click on Customers once again.
You will see the list of customers who are currently added to your OpenCart site. Note the Status column. If the customer is Enabled, then they have access to your store front. Click on EDIT on the far right for the specific customer that you wish to change.
- Click on SAVE in the top right corner to save your changes.
Using these options, you can keep unwanted customers from getting to your store front. These options allow you to manage specfic customers or prevent access by groups using the .htaccess file.