Introduction
The Cpanel
category creates hookable events for cPanel API 1, cPanel API 2, or UAPI functions.
API::Module::function
Cpanel
events all use the API::Module::function
naming format, where:
API
is the API that calls the hook point.- Use
Api1
for cPanel API 1 functions,Api2
for cPanel API 2 functions, orUAPI
for UAPI functions. - This value is case-sensitive.
- Use
Module
is the function's module name (for example,StatsBar
).function
is the function name (for example,stat
).
Available Stages:
pre
— Hook action code runs before the event.post
— Hook actions code runs after the event.
post
stage call failure
If an API call fails to execute, whether the post
-stage hook runs depends on which API that you use.
- API1 function post-hooks always run, regardless of whether the call succeeds.
-
API2 function post-hooks always run, but they also include data about whether the API function succeeds.
-
In your post-hook code, the
data->{'output'}{'result'}
section displays the call's status. For example:123456"output" : [
{
"reason" : "File not found.\n",
"result" : 0
}
]
-
- UAPI post-hooks do not run if the API call fails.
Action Code Runs As:
The cPanel user.
Important:
Remote API calls that proxy to cPanel's API and cPanel API calls that are performed as a reseller in the cPanel interface will affect this user and not the authenticated user.
Blocking Attribute:
Escalate Privileges Attribute:
Output parameters
Note:
The chosen stage determines the event's output. Select the appropriate tab to view output parameters for that stage.
Parameter |
Type |
Description |
Possible values |
Example |
args |
See description. |
|
See the desired function's documentation. |
|
output |
string |
A variable reference, which cPanel & WHM is likely to overwrite during processing. |
Important: Expect an undefined value. |
undef |
user |
string |
The cPanel user's username. |
A valid cPanel username on the server. |
username |
Post
Parameter |
Type |
Description |
Possible values |
Example |
user |
string |
The user for whom the password will change. |
A valid username on the server. |
username |
new_password |
string |
The user's new password. |
A secure password. |
12345luggage |
rawout |
string |
The event's raw output. |
A string value. |
This is raw output. |
applist |
string |
A list of applications for which the password changed. |
A list of one or more application names. |
application1,applicat |