.pdf)
WHM Plugins
| API Version: | 1 - Click here for documentation |
|---|---|
| Syntax: | LeechProtect::setup( dir, item, type ) |
| Description: | This function provides a method for querying values in the .leechprotect configuration file in a particular directory. |
| Parameters: | |
| dir (string) | |
| The directory that contains the file to query. | |
| item (string) | |
| The item to query in the configuration file. Acceptable values include email, kill, numhits, and url. | |
| type (string) | |
| The format for the output. html retrieves HTML-encoded output. uri retrieves URI-encoded output. check or checkbox will return checked if the value is present. | |
| Returns: | |
The output will depend on the items chosen.
|
| API Version: | 1 - Click here for documentation |
|---|---|
| Syntax: | LeechProtect::showpasswdfile( dir ) |
| Description: | Retrieve the location of the passwd file for a specified directory. |
| Parameters: | |
| dir (string) | |
| The directory for which to locate the passwd file. | |
| Returns: | |
The output should resemble the following: /home/user/.htpasswds/public_html/test/passwd |
| API Version: | 1 - Click here for documentation |
|---|---|
| Syntax: | LeechProtect::disable( dir ) |
| Description: | Disable leech protection for a specified directory. This function requires access to the 'cpanelpro_leechprotect' or 'leechprotect' feature. In demo mode, this function requires access to the 'leechprotect' feature. |
| Parameters: | |
| dir (string) | |
| The directory for which to disable leech protection. | |
| Returns: | |
This function does not produce any output when used in an array. Otherwise, the output should resemble the following: LeechProtection disabled for /home/user/public_html/test |
| API Version: | 1 - Click here for documentation |
|---|---|
| Syntax: | LeechProtect::status( dir ) |
| Description: | Print whether or not leech protection is enabled for a specific directory. |
| Parameters: | |
| dir (string) | |
| The directory to query. | |
| Returns: | |
The output should resemble the following: 'enabled' or 'disabled' |
| API Version: | 1 - Click here for documentation |
|---|---|
| Syntax: | LeechProtect::enable( dir, numhits, badurl, email, killcompro ) |
| Description: | Enable leech protection for a specified directory. This function also keeps track of how many times a user logs into a protected directory over a 2-hour period. If the user accessing the directory exceeds a defined threshold, the function will take a specified action. This function requires access to the 'cpanelpro_leechprotect' or 'leechprotect' feature. In demo mode, this function requires access the 'leechprotect' feature. |
| Parameters: | |
| dir (string) | |
| The directory to which to add leech protection. | |
| numhits (integer (optional)) | |
| The number of times a user can log into a directory before triggering leech protection. This value defaults to 4. | |
| badurl (string) | |
| The URL to redirect users who exceed the leech protection threshold. | |
| email (string) | |
| The email address to which to send notices after leech protection is triggered. | |
| killcompro (boolean) | |
| Passing 1 to this function disables the offending account. | |
| Returns: | |
This function will not produce any output when used in an array. Otherwise, the output should resemble the following: LeechProtection enabled for public_html/test |