Software Development Kit

cPanel & WHM's API [+] cPanel & WHM's API [-]


Modules and Plugins [+] Modules and Plugins [-]


cPanel & WHM Hooks [+] cPanel & WHM Hooks [-]


cPAddons (Site Software) [+] cPAddons (Site Software) [-]


System Administration [+] System Administration [-]


Developer Software [+] Developer Software [-]


Back to All Documentation



integrationblogcta.jpg

DenyIp Module Documentation

Provides access into the cPanel Deny IP Feature

The functions within this module may or may not be governed by a feature list. The required feature list may vary from function to function, to review a total list of the available features sets on a cPanel server, please see "Feature Manager" in WHM.

DenyIp::adddenyip

API Version: 1 - Click here for documentation
Syntax: DenyIp::adddenyip( ip, quiet )
Description: Add a deny from IP line to the account's public_html/.htaccess file. This function requires access to the 'ipdeny' feature. This function is not available in demo mode.
Parameters:  
  ip (string)
  The IP address to deny. This parameter takes the following formats:
192.168.0.1 Single IP Address
192.168.0.1-192.168.0.58 Range
192.168.0.1-58 Implied Range
192.168.0.1/32 CIDR Format
10. Implies 10.*.*.*.
  quiet (boolean (optional))
  If set to 1, this parameter will suppress error messages. This value defaults to 0.
Returns:  
 
If successful, the output should resemble the following:
Users from the IP address(s) 192.168.0.1 will not be able to access your site.
If the function encounters an error, it will be printed unless 'quiet' is true.

DenyIp::deldenyip

API Version: 1 - Click here for documentation
Syntax: DenyIp::deldenyip( ip )
Description: Remove a deny from IP line in the account's public_html/.htaccess file. This function requires access to the 'ipdeny' feature. This function is not available in demo mode.
Parameters:  
  ip (string)
  The IP address to remove. This parameter takes the following formats:
192.168.0.1 Single IP Address
192.168.0.1-192.168.0.40 Range
192.168.0.1-40 Implied Range
192.168.0.1/32 CIDR Format
10. Implies 10.*.*.*.
Returns:  
 
The output should resemble the following:
The IP address 192.168.0.1 will now be able to access your site.


Topic revision: r2 - 27 Mar 2012 - 17:48:54 - Main.JenniferDoubrava