|
1 |
| -# (WHMCS Addon Module) CSF Unblocker for WHM |
| 1 | +# (WHMCS Addon Module) Firewall Unblocker for CSF |
2 | 2 |
|
3 | 3 | This extension provides the ability to self-service Unblock IPs from within WHMCS.
|
4 | 4 |
|
5 |
| -### Pre-requisites for usage: |
| 5 | +### Pre-requisites for Usage: |
6 | 6 |
|
7 |
| -- software-ConfigServer-csf (Reseller ACL in WHM needs this) |
8 |
| -- whmuser:0:USE,ALLOW,DENY,GREP,UNBLOCK (/etc/csf/csf.resellers) |
| 7 | +- `software-ConfigServer-csf` (Reseller ACL in WHM needs this enabled) |
| 8 | +- `whmuser:0:USE,ALLOW,DENY,GREP,UNBLOCK` (/etc/csf/csf.resellers) |
9 | 9 |
|
10 |
| -### Problems that need resolving: |
| 10 | +### Installing the WHMCS Module: |
11 | 11 |
|
12 |
| -- Client Area Output doesn't have necessary tokens; made elsewhere |
13 |
| -- cPanel XML-API (deprecated 2017-2018) used, consider JSON-API |
| 12 | +- Download the latest version of the module from the repository |
| 13 | +- Upload the unblockip/ folder into WHMCS_WEBROOT/modules/addons/ |
| 14 | +- Visit WHMCS Admin > Settings > Addon Modules > enable the Module |
| 15 | +- From there, it will be visible in the Admin and Client interfaces |
14 | 16 |
|
15 |
| -### Documentation for old/new APIs: |
| 17 | +### What the Module does for you: |
16 | 18 |
|
17 |
| -- https://github.com/CpanelInc/xmlapi-php |
18 |
| -- https://api.docs.cpanel.net/whm/introduction |
19 |
| - |
20 |
| -### Client Area - problematic code: |
21 |
| - |
22 |
| -The breadcrumb, template, and other keys that you need to display the client area output are returned by the `unblockip_clientarea()` function in the `unblockip.php` file. These keys are returned as an array which includes 'pagetitle', 'breadcrumb', 'templatefile', 'requirelogin', and 'vars'. These keys are used by the WHMCS system to render the client area output. |
23 |
| - |
24 |
| -In order to fix the issue with the missing keys, you need to make sure that the `unblockip_show()` function in the `hooks.php` file is calling the `unblockip_clientarea()` function in the `unblockip.php` file, and that it is passing the correct variables to it. Once that is done, you can use the returned array of keys to display the client area output. |
25 |
| - |
26 |
| -ie. |
27 |
| - |
28 |
| - function unblockip_show($vars) { |
29 |
| - search_for_ip_block($vars); |
30 |
| - $returned_values = unblockip_clientarea($vars); // call the unblockip_clientarea function and store the returned value |
31 |
| - if (!empty($returned_values)) { |
32 |
| - $smarty = new Smarty(); |
33 |
| - $smarty->assign($returned_values); |
34 |
| - $smarty->caching = false; |
35 |
| - $smarty->compile_dir = $GLOBALS['templates_compiledir']; |
36 |
| - $output = $smarty->fetch(dirname(__FILE__) . '/templates/clientareaoutput.tpl'); |
37 |
| - } else { |
38 |
| - $output = ""; |
39 |
| - } |
40 |
| - return $output; |
41 |
| - } |
42 |
| - |
43 |
| -### Feature sets for the original: |
44 |
| - |
45 |
| -- Allow your customers to easily unblock their ip from your cPanel and DirectAdmin servers CSF firewall. |
| 19 | +- Allow your customers to easily unblock their IP from your cPanel and DirectAdmin servers' CSF firewall. |
46 | 20 | - Checks for an IP Block across every cPanel and DirectAdmin server that is associated with an active service of the WHMCS Client.
|
47 |
| -- Uses a smarty template file to easily change look/feel of the addon. |
| 21 | +- Uses a Smarty template file to easily change look/feel of the addon. |
48 | 22 | - Only shows the link to the module in your menu if the client has an active cPanel service.
|
49 |
| -- Displays the csf log entry so the client can see the reason why the ip was blocked. |
50 |
| -- Logs successful unblocks in the whmcs client log. |
51 |
| -- For added security you can set maximum number of unblocks a client can issue in a configurable minute time period. |
52 |
| -- Quickly search for and unblock an IP address from all active cPanel servers from the WHMCS admin area. |
53 |
| -- Automatically check for and remove an ip block when upon client login to WHMCS (Optional, disabled by default). |
54 |
| -- Free and open source under the BSD Modified License. |
55 |
| -- Easy installation |
56 |
| - |
57 |
| -### System Requirements (update!) |
58 |
| - |
59 |
| -- WHMCS 5.0.3 or later |
60 |
| -- cPanel properly configured in WHMCS |
61 |
| -- CSF 5.40 or later |
62 |
| - |
63 |
| -### CSF Implementation Method |
64 |
| - |
65 |
| -- cpsess##########/cgi/configserver/csf.cgi?action=kill&ip=103.103.103.103 |
| 23 | +- Displays the CSF log entry so the client can see the reason why the IP was blocked. |
| 24 | +- Logs successful Unblocks in the WHMCS client log. |
| 25 | +- For added security, you can set maximum number of Unblocks a client can issue in a configurable minute time period. |
| 26 | +- Quickly search for and Unblock an IP Address from all active cPanel servers from the WHMCS admin area. |
| 27 | +- Automatically check for and remove an IP Block when upon client login to WHMCS (Optional, disabled by default). |
| 28 | +- Easy installation! |
| 29 | + |
| 30 | +### System Requirements: |
| 31 | + |
| 32 | +- Server Integrated OK |
| 33 | +- WHMCS v8.x latest |
| 34 | +- CSF 14.x latest |
| 35 | +- PHP# latest |
0 commit comments