Personal tools
Namespaces

Variants
Actions

Unban Center For WHMCS

From ModulesGarden Wiki
Revision as of 15:38, 13 December 2019 by Magdalena (Talk | contribs)

Jump to: navigation, search

Contents

About Unban Center For WHMCS

Unban Center For WHMCS allows your clients to easily unban IP addresses in such submodules as cPanel, DirectAdmin, InterWorx and Plesk, directly from your WHMCS.

As an appealing alternative, the module will let you create your own submodules so as to integrate them with other systems and control panels.
You will be also able to manage blacklists with IP addresses and IP ranges that cannot be unbanned, as well as unban your customers automatically after they log in to your client area.

  • Client Area Features:
✔ Automatically Detect And Unban IP Addresses From:
✔ Control Panel
✔ Control Panel Hosted On Client's VPS/Dedicated Servers
✔ Unban IP Addresses From Control Panels Automatically After Logging In To WHMCS Client Area
✔ Check If IP Address Is Banned
✔ Show Reason Of Ban
✔ Show All Banned IP Addresses On VPS/Dedicated Servers
✔ View Time Left Until Next Available Unban Action
✔ Auto Complete VPS/Dedicated Server Credentials To Unban IP Addresses
✔ Receive Email Notification After Unbanning IP Address Automatically
  • Admin Area Features:
✔ View Dashboard Summary:
✔ Enabled Products
✔ Pending Tasks
✔ Available Services
✔ Last Cron Run
✔ Configure Unban Features Per Product:
✔ Toggle Unban Availability
✔ Define Minimum Unban Delay - Protection From Abuse
✔ Configure Unban Location On Control Panel
✔ Prevent Clients From Unbanning IP Addresses Different Than Their Current One
✔ Automatically Unban Clients After They Log In To WHMCS Client Area
✔ Choose Email Template To Notify Clients About Auto Unban
✔ Show Ban Reason Before Unban Attempt
✔ Show All Banned IP Addresses On Client's Dedicated/VPS Server
✔ Toggle Debug Mode
✔ Define Global Blacklists Of Elements Not To Be Unbanned:
✔ IP Addresses
✔ IP Ranges
✔ Unban Single Client From Chosen Product:
✔ Hosting Account
✔ Dedicated/VPS Server
✔ Check If Client IP Address Is Banned
✔ View And Delete Logs
  • Supported Modules:
✔ cPanel & cPanel Extended For WHMCS - CSF, cPHulk And Imunify360
✔ Plesk & Plesk Extended For WHMCS - Fail2Ban
✔ DirectAdmin & DirectAdmin Extended For WHMCS - CSF And IPs Blacklist
✔ InterWorx & InterWorx Extended For WHMCS - Native Firewall
  • General Info:
✔ Supports IPv4 And IPv6
✔ Requires MySQL 5.7 And Later For IPv6
✔ Intuitive Creation Of Additional Submodules
✔ Multi-Language Support
✔ Supports PHP 5.6 Up To PHP 7.3
✔ Supports WHMCS Template Six
✔ Supports WHMCS V7.7 And Later
✔ Easy Module Upgrade To Open Source Version

Installation

This tutorial will show you how to successfully install and configure Unban Center For WHMCS.

We will guide you step by step through the whole installation and configuration process.

Note: If you are still using any versions of Unban Center For WHMCS prior to v2.x, read about it here.

1. Log in to our client area and download the module.
UB2 1.png
2. In the downloaded file you might find one or two packages that support different PHP versions.

In the most recent versions of the module, you will find only one package that supports PHP 7.1 and later.
If you need a package for the previous versions of PHP, please contact our support.

PHP71 73.png
Previous updates of the module may contain two packages dedicated to various PHP versions.

The first one that supports PHP 5.6 up to PHP 7.0, and the second one addressed to PHP 7.1 up to PHP 7.3.
Note: Keep in mind that PHP versions 5.6 up to 7.0 are no longer officially supported and their security issues are not fixed or released any more. Find more info here.

PHP56 73.png
Important: This situation does not affect the open source version of this module which can be applied to any PHP from version 5.6 and later.
Note: You can check the current PHP version in your WHMCS. To do so, proceed to 'Utilities' → 'System' → 'PHP Info'.
3. Once you have chosen the package with the right PHP version, extract it and upload its content into the main WHMCS directory.

The content of the chosen PHP version files to upload should look like this.

UB2 2.png
4. When you install Unban Center For WHMCS for the first time, you have to rename the 'license_RENAME.php' file.

The file is located in 'modules/addons/unbanCenter/license_RENAME.php'. Rename it from 'license_RENAME.php' to 'license.php'.

UB2 3.png
5. In order to configure your license key, you have to edit the previously renamed 'license.php' file.

Enter your license key between the quotation marks as presented on the following screen. You can find your license key in our client area → 'My Products'.

UB2 4.png
6. In the next step, set up the 'storage' folder as recursively writable.

This folder is available at 'your_whmcs/modules/addons/unbanCenter/' .

UB2 4 2.png
7. Now you have to activate the module in your WHMCS system.

Log in to your WHMCS admin area. Go to 'Setup' 'Addon Modules'. Afterwards, find 'Unban Center' and press the 'Activate' button.

UB2 5.png
8. In the next step you need to permit access to this module.

To do so, click on the 'Configure' button, tick 'Full Administrator' and press 'Save Changes'.

UB2 6.png
9. Finally, set up the cron command line provided below and define its frequency (5 minutes interval is suggested).
php -q /yourWHMCS/modules/addons/unbanCenter/cron/cron.php Tasks

This will allow to enable the feature which automatically unbans customers' IP addresses after they log in to the WHMCS client area.
Important: Make sure that the 'exec' function is not blocked in your PHP configuration.


Note: Once cron is executed, it operates continuously.
If you stop the cron processes manually, please delete the entire content of the '/yourWHMCS/modules/addons/unbanCenter/storage/crons/' folder or execute the command below:

rm -r /yourWHMCS/modules/addons/unbanCenter/storage/crons/*

This will allow you to run the cron process again next time. Do not forget to replace 'yourWHMCS' with your WHMCS root location.

10. You have just successfully installed Unban Center For WHMCS!

You can access your module at 'Addons' 'Unban Center'.

UB2 8.png

Configuration and Management

Unban Center For WHMCS allows you to provide your clients with an ability to easily unban desired IP addresses from external servers.

Additionally, you are able to protect specific IP addresses from the unban action.

Unban Types

Our module has been designed in such a way so as to allow you to manage banned IP addresses on several different panels of a particular type.

These are:

  • cPanel - unban on CSF, cPHulk (Blacklist Management and History Reports) or both at once as well as Imunify360
  • DirectAdmin - unban on CSF, IPs blacklist (/usr/local/directadmin/data/admin/ip_blacklist) or both at once
  • InterWorx - unban on native firewall
  • Plesk - unban on Fail2Ban
  • You may also create your own submodules. To learn how to do that, please read carefully this section.

It is also possible to unban only the current IP address. You simply need to select such option (i.e. Allow User To Unban Current IP Address Only)
while setting the configuration or create a list of IP addresses that, no matter what type you have chosen, will not be unbanned (Blacklist of IP addresses).

Dashboard

In dashboard you can find the summary of currently enabled unban configuration for products, pending tasks, active services and last cron run.
The tasks list allows you to follow the current auto-unbans for the clients who log in to their WHMCS client area (the option may be enabled in products configuration).
These will be performed via cron.
UB2 10 2.png

Configuration of Products

Here we show you how you can easily enable and configure unban action for your selected products.

Let us show you how to enable unban functionality for cPanel Extended product.
First, go to the 'Products' section and press the 'Edit' button next to the chosen product.

UB2 11.png
Press 'Enable' and then define 'Minimum Delay Time' intervals to declare how often your client will be able to perform unban action on a specific product.

Next, select desired value from 'Unban Type', and remember that in case of cPanel you may choose between:

  • Unban on CSF
  • Unban on cPHulk
  • Unban on both of the above
  • Unban on Imunify360

Additionally, you can permit your clients to unban their current IP address as well as automatically unban them after they log in - Auto Unban After Login to client area (cron execution is required).
Note Auto unbanning feature does not work for dedicated/VPS servers type.

Select the email template that will be used to notify clients when their IP address has been automatically unbanned.
You may easily preview and edit the default, inbuilt with the module template content at 'Setup' → 'Email Templates', read more here.

You can also allow your clients to see all banned IP addresses' from the panel on their VPS/Dedicated Servers.
In case of Hosting Account, your clients may get an option to show the reason of ban before any attempt to unban the IP address.


Finally, by marking the 'Debug Mode' you will activate the extended logs in the WHMCS module log section.
Confirm those settings by pressing the 'Save Changes' button.

UB2 12.png

Configuration of Blacklists

The blacklist section allows you to create lists of IP addresses that cannot be unbanned from your panels.

This section is divided into two tabs. The first one allows you to create a blacklist of a single IP addresses.
To add it, press the 'New IP Address' button.

UB2 12 1.png
Next, provide IP address you want to add to the blacklist (either in IPv4 or IPv6 format).

Additionally, you can provide a description for easier identification.

UB2 12 2.png
The second, 'IP Ranges' tab allows you to define entire ranges of IP addresses that will be prevented from being unbanned.

Press 'New IP Range' to add a new blacklisted range.

UB2 12 3.png
Now, provide the start and end of IP addresses range (in either IPv4 or IPv6 format).

Additionally, you can provide a description for easier identification.

UB2 12 4.png

Unban Users

This section allows you to unban your client's IP address from any external server on which they own an account.

You can unban IP address assigned to your client's account as well as any custom IP address.
When ready, press 'Unban' as shown on the following screen.
Note: You are able to unban IP addresses only from external servers enabled at the 'Products' section.

UB2 20.png
Data on 'Username' , 'Password' and IP address will be filled in automatically.

You can optionally add a custom hostname as well as add port number and select SSL connection.
Note: If you leave the hostname empty, the server details assigned to that product will be used instead.

Next, leave the default client's IP address to unban or provide a custom one.

Note: These connection details will appear only in case of dedicated/VPS products used by the client. For hosting accounts, only 'IP Address To Unban' field is available.

UB2 21.png
You may also check if the client's IP address has a banned status without unbanning it. Simply press 'Check Status' on the users list.
UB2 22.png
Now, use the default client's IP address or, alternatively, provide a custom IP address to check its ban status on the control panel.
UB2 23.png

Logs

All unban requests and their results can be found in the 'Logs' section.

You can find here information related to user or admin who requested unban action and its date.
You can also clear old and unnecessary log entries by selecting them and pressing the 'Delete button.

UB2 16.png

Client Area

Let us proceed to the client area → 'Services' 'My Services' in order to try out the unban action.
Press 'IP Unban Center' on the sidebar menu to proceed to 'Unban Center'.
Note 1: This button is visible only if you have enabled unban support in products configuration.
Note 2: If the option 'Auto Unban After Login' is enabled, clients' IP addresses will be automatically unbanned from all configured control panels the moment they log in to the WHMCS client area.

UB2 13.png
Now, select the product for which you want to perform action of unbanning an IP address.
UB2 14.png
Data on 'Username' , 'Password' and 'IP address' will be filled in automatically.

Optionally, you can also add a custom hostname as well as add port number and select SSL connection.
Note: If you leave the hostname empty, the servers details assigned to that product will be used instead.

Next, leave the default client's IP address to unban or provide a custom one.

UB2 15.png
Note: These connection details will appear only in case of dedicated/VPS products used by the client. For hosting accounts, only 'IP Address To Unban' field is available.
UB2 18.png
Once the action is completed, the IP address will be unbanned immediately and you will be notified about the results.
UB2 19.png
In case you have set up a low delay time, you will need to wait for the next unban attempt.
UB2 19 2.png
If enabled, the option will allow your clients to preview all banned IP addresses on the server.

Important: This feature is only valid for dedicated/VPS servers.

UB2 19 3.png
When you try to open this section for the first time, the 'Server Details popup may show up. Provide your control panel credentials and press 'Connect' .
UB2 19 6.png
Here you can see the list of all banned IP addresses on the control panel of a server. You can unban them in the same way as explained in the previous steps.
UB2 19 4.png

Tips

1. Provided data to connect with a server and view a list of banned IP addresses will be stored and available to use when trying to connect another time.
Keep in mind that in case the connection data have changed, simply provide new data in the adequate fields and they will override the previous ones.

Creating 3rd Party Submodule

The main goal of Unban Center For WHMCS is to allow you to quickly and easily create additional submodules.

All you need is a little knowledge of PHP programming language and documentation of integrated module API.
Required information regarding the submodule itself is located inside the exemplary submodule.
It can be found at 'yourWHMCS/modules/addons/unbanCenter/app/Modules/Sample/Sample.php'.
Owing that, you are able to make your offer much more competitive and extend it to other systems, control panels and servers.

UB2 17.png
Start with renaming the copy of the 'Sample' folder to the name used by your 3rd party module.

Let us say that the folder with the module you wish to integrate with Unban Center For WHMCS is located in 'your_whmcs/modules/servers/' and is named 'DummyIntegration'.
In this case, your folder at 'yourWHMCS/modules/addons/unbanCenter/app/Modules/' should be named 'DummyIntegration'.
The file 'Sample.php' located in the previously renamed folder should be renamed to 'DummyIntegrationUnbanModule.php'.
Afterward, edit the 'DummyIntegrationUnbanModule.php' file and follow the instructions placed inside.

Update Instructions

An essential guidance through the process of updating the module is offered here.

Note: Updating the module from any version prior to 2.0.0 will start the migration process to move settings configured in the previous version to the new one.
These cover: the configuration status, unban type, minimum delay time and option to unban only current IP address. Any created blacklists of IP addresses will not be migrated!
You also need to set recursively writable permissions for storage directory in 'yourWHMCS/modules/addons/unbanCenter/' location.

Keep in mind there is a quick and easy option in our client area that will let you upgrade the license of your module to an open source version at any time - and at a lower price!
To take advantage of it, simply use the License Upgrade button located on the product's page and a discounted invoice will be generated automatically.

Common Problems

1. When you have problems with connection, check whether your SELinux or firewall does not block ports.
2. After update, some functionalities are not working properly.

Cause: Your browser stores old JavaScript in its cache.
Solution: Reload full page by using the appropriate key combination to bypass your cache.

3. If you were using any version of the module prior to 2.0.0, note that after upgrading to the latest version the template integration code is no longer needed.
4. If you are getting 'Syntax error or access violation' errors when using an address in IPv6 format, make sure that MySQL 5.7 or higher version is installed.
Navigation
WHMCS Modules
WHMCS Widgets
Translations
cPanel Modules
General
FAQ
Community
Unban Center For WHMCS