Page tree
Skip to end of metadata
Go to start of metadata

 

Introduction

The Whostmgr category's events occur during WHM functions. 

Accounts::change_package


This event triggers whenever an account's hosting plan (package) changes, or whenever a hosting plan is edited.

Available Stages:

  • pre — Hook action code runs before the change.
  • post — Hook actions code runs after the change.

Action Code Runs As:

root

Blocking Attribute:

Escalate Privileges Attribute:

N/A

Output parameters

Note:

The chosen stage determines the event's output. Select the appropriate tab to view output parameters for that stage. 

ParameterTypeDescriptionPossible valuesExample
cur_pkgstring

The hosting plan's (package's) current name.

A valid hosting plan name.oldpackagename
new_pkgstring

The new hosting plan's (package's) name.

A valid hosting plan name.

newpackagename
userstringThe user for whom the package will change.A valid username on the server.username
ParameterTypeDescriptionPossible valuesExample
cur_pkgstring

The hosting plan's (package's) current name.

A valid hosting plan name.oldpackagename
new_pkgstring

The new hosting plan's (package's) name.

A valid hosting plan name.

newpackagename
userstringThe user for whom the package changed.A valid username on the server.username


Accounts::Create


This event triggers whenever the system creates an account.

Available Stages:

  • pre — Hook action code runs before the system creates the account.
  • post — Hook actions code runs after the system creates the account.

Action Code Runs As:

root

Blocking Attribute:

Escalate Privileges Attribute:

N/A

Output parameters

This event returns the WHM API 1  createacct function's input parameters and values .

 

Accounts::Modify


This event triggers whenever the system modifies an account.

Available Stages:

  • pre — Hook action code runs before the change.
  • post — Hook actions code runs after the change.

Action Code Runs As:

root

Blocking Attribute:

Escalate Privileges Attribute:

N/A

Output parameters

This event returns the WHM API 1  modifyacct function's input parameters and values .


Accounts::Remove


This event triggers whenever the system deletes an account.

Available Stages:

  • pre — Hook action code runs before the system deletes the account.
  • post — Hook actions code runs after the system deletes the account.

Action Code Runs As:

root

Blocking Attribute:

Escalate Privileges Attribute:

N/A

Output parameters

This event returns the WHM API 1  removeacct function's input parameters and values.

 

Accounts::set_shell


This event triggers whenever the system modifies an account's shell.

Available Stages:

  • pre — Hook action code runs before the system modifies the shell.
  • post — Hook actions code runs after the system modifies the shell.

Action Code Runs As:

root

Blocking Attribute:

Escalate Privileges Attribute:

N/A

Output parameters

Note:

The chosen stage determines the event's output. Select the appropriate tab to view output parameters for that stage. 

ParameterTypeDescriptionPossible valuesExample
new_shellstringThe new shell setting.
  • noshell
  • nologin
  • false
  • shutdown
  • sync
noshell
current_shellstringThe current shell setting.
  • noshell
  • nologin
  • false
  • shutdown
  • sync
nologin
userstringThe account for which shell settings will change.A valid username on the server.username
ParameterTypeDescriptionPossible valuesExample
new_shellstringThe new shell setting.
  • noshell
  • nologin
  • false
  • shutdown
  • sync
noshell
current_shellstringThe previous shell setting.
  • noshell
  • nologin
  • false
  • shutdown
  • sync
nologin
userstringThe account for which shell settings changed.A valid username on the server.username
rawoutstringAdditonal raw output from the event.A string value.raw output


Accounts::suspendacct


Note:

This event is only available in cPanel & WHM version 11.46. 

This event triggers whenever the system suspends an account.

Available Stages:

  • pre — Hook action code runs before the system suspends the account.
  • post — Hook actions code runs after the system suspends the account.

Action Code Runs As:

root

Blocking Attribute:

Escalate Privileges Attribute:

N/A

Output parameters

Note:

The chosen stage determines the event's output. Select the appropriate tab to view output parameters for that stage. 

ParameterTypeDescriptionPossible valuesExample
userstringThe account to suspend.A valid username on the server.

username

reasonstringThe reason for suspension, if one exists.A string value.Nonpayment
disallowunbooleanWhether resellers can unsuspend the account.
  • 1 — Resellers cannot unsuspend the account.
  • 0 — Resellers can unsuspend the account.
1
ParameterTypeDescriptionPossible valuesExample
userstringThe suspended account.A valid username on the server.username
reasonstringThe reason for suspension, if one exists.A string value.Nonpayment
disallowunbooleanWhether resellers can unsuspend the account.
  • 1 — Resellers cannot unsuspend the account.
  • 0 — Resellers can unsuspend the account.
1
rawoutstringThe event's raw output.A string value.raw output


Accounts::unsuspendacct


Note:

This event is only available in cPanel & WHM version 11.46. 

This event triggers whenever the system unsuspends an account.

Available Stages:

  • pre — Hook action code runs before the system unsuspends the account.
  • post — Hook actions code runs after the system unsuspends the account.

Action Code Runs As:

root

Blocking Attribute:

Escalate Privileges Attribute:

N/A

Output parameters

Note:

The chosen stage determines the event's output. Select the appropriate tab to view output parameters for that stage. 

ParameterTypeDescriptionPossible valuesExample
userstringThe account to unsuspend.A valid username on the server.

username

ParameterTypeDescriptionPossible valuesExample
userstringThe unsuspended account.A valid username on the server.username
rawoutstringThe event's raw output.A string value.raw output

Domain::Park


This event triggers whenever a user creates a domain alias (parks a domain).

Available Stages:

  • pre — Hook action code runs before the change.
  • post — Hook actions code runs after the change.

Action Code Runs As:

root

Blocking Attribute:

Escalate Privileges Attribute:

N/A

Output parameters

Note:

The chosen stage determines the event's output. Select the appropriate tab to view output parameters for that stage. 

ParameterTypeDescriptionPossible valuesExample
target_domainstring

The domain name for which to create an alias.

A valid domain name.oldpackagename
new_domainstring

The domain name to which the alias will point.

A valid domain name.

newpackagename
userstringThe user who will create the alias.A valid username on the server.username
ParameterTypeDescriptionPossible valuesExample
target_domainstring

The domain name for which to create an alias.

A valid domain name.oldpackagename
new_domainstring

The domain name to which the alias will point.

A valid domain name.

newpackagename
userstringThe user who will create the alias.A valid username on the server.username

Lang::PHP::ini_set_content


Notes:

  • This event is only available in cPanel & WHM version 56 or later.
  • When you hook this event, you must also hook UAPI's LangPHP::php_ini_set_user_content function to ensure consistent behavior.

 

This event triggers when an administrator uploads a new complete php.ini file.

Available Stages:

  • pre — Hook action code runs before the change.
  • post — Hook actions code runs after the change.

Action Code Runs As:

root

Blocking Attribute:

Escalate Privileges Attribute:

N/A

Output parameters

This event returns the WHM API 1 php_ini_set_content function's input parameters and values.

Lang::PHP::ini_set_directives


Notes:

This event triggers when an administrator changes the directives in the php.ini file.

Available Stages:

  • pre — Hook action code runs before the system changes the directives.
  • post — Hook actions code runs after the system changes the directives.

Action Code Runs As:

root

Blocking Attribute:

Escalate Privileges Attribute:

N/A

Output parameters

This event returns the WHM API 1 php_ini_set_directives  function's input parameters and values.

Lang::PHP::set_handler


Note:

This event is only available in cPanel & WHM version 56 or later.

This event triggers when an administrator changes the handler that serves the PHP files for any version of PHP.

Available Stages:

  • pre — Hook action code runs before the system changes the handler.
  • post — Hook actions code runs after the system changes the handler.

Action Code Runs As:

root

Blocking Attribute:

Escalate Privileges Attribute:

N/A

Output parameters

This event returns the WHM API 1 php_set_handler  function's input parameters and values.

Lang::PHP::set_system_default_version


Note:

This event is only available in cPanel & WHM version 56 or later.

 

This event triggers when an administrator changes the system default PHP version.

Available Stages:

  • pre — Hook action code runs before the system changes the default PHP version.
  • post — Hook actions code runs after the system changes the default PHP version.

Action Code Runs As:

root

Blocking Attribute:

Escalate Privileges Attribute:

N/A

Output parameters

This event returns the WHM API 1 php_set_system_default_version  function's input parameters and values.

Lang::PHP::set_vhost_versions


Notes:

  • This event is only available in cPanel & WHM version 56 or later.
  • When you hook this event, you must also hook UAPI's LangPHP::php_set_vhost_versions function to ensure consistent behavior.

This event triggers when an administrator changes the PHP version for a specific virtual host.

Available Stages:

  • pre — Hook action code runs before the system changes the virtual host's PHP version.
  • post — Hook actions code runs after the system changes the virtual host's PHP version.

Action Code Runs As:

root

Blocking Attribute:

Escalate Privileges Attribute:

N/A

Output parameters

This event returns the WHM API 1 php_set_vhost_versions  function's input parameters and values.

RemoteMySQL::activate_profile


Note:

This event is only available in cPanel & WHM version 62 or later.

This event triggers whenever the system activates a Remote MySQL® profile.

Available Stages:

  • pre — Hook action code runs before the system activates the remote profile.
  • post — Hook actions code runs after the system activates the remote profile.

Action Code Runs As:

root

Blocking Attribute:

Escalate Privileges Attribute:

N/A

Input parameters

Note:

The chosen stage determines the event's input. Select the appropriate tab to view input parameters for that stage. 

ParameterTypeDescriptionPossible valuesExample
profile_namestringThe Remote MySQL profile's name.A valid profile name on the server.

notlocalhost

ParameterTypeDescriptionPossible valuesExample
profile_namestringThe Remote MySQL profile's name.A valid profile name on the server.

notlocalhost

Output parameters

Note:

The chosen stage determines the event's output. Select the appropriate tab to view output parameters for that stage. 

N/A

ParameterTypeDescriptionPossible valuesExample
resultBoolean

The Remote MySQL profile's name.

  • 1 — The function succeeded.

  • 0 — The function failed.

notlocalhost


ParkAdmin::park


This event triggers whenever the system parks a domain.

Available Stages:

  • pre — Hook action code runs before the system parks the domain.
  • post — Hook actions code runs after the system parks the domain.

Action Code Runs As:

root

Blocking Attribute:

Escalate Privileges Attribute:

N/A

Output parameters

Note:

The chosen stage determines the event's output. Select the appropriate tab to view output parameters for that stage. 

ParameterTypeDescriptionPossible valuesExample
userstringThe cPanel account that owns the domains.A valid username on the server.

username

target_domainstringThe domain on which to park the new_domain domain.A valid domain.example.com
new_domainstringThe domain to park on the target_domain domain.A valid domain.parkeddomain.com
ParameterTypeDescriptionPossible valuesExample
userstringThe cPanel account that owns the domains.A valid username on the server.

username

target_domainstringThe domain on which the system parked the new_domain domain.A valid domain.example.com
new_domainstringThe domain that the system parked on the target_domain domain.A valid domain.parkeddomain.com


ParkAdmin::unpark


This event triggers whenever the system unparks a domain.

Available Stages:

  • pre — Hook action code runs before the system unparks the domain.
  • post — Hook actions code runs after the system unparks the domain.

Action Code Runs As:

root

Blocking Attribute:

Escalate Privileges Attribute:

N/A

Output parameters

Note:

The chosen stage determines the event's output. Select the appropriate tab to view output parameters for that stage. 

ParameterTypeDescriptionPossible valuesExample
userstringThe cPanel account that owns the domains.A valid username on the server.

username

parent_domainstringThe domain on which the domain is parked.A valid domain.example.com
domainstringThe domain to unpark.A valid domain.parkeddomain.com
ParameterTypeDescriptionPossible valuesExample
userstringThe cPanel account that owns the domains.A valid username on the server.

username

parent_domainstringThe domain on which the domain was parked.A valid domain.example.com
domainstringThe unparked domain.A valid domain.parkeddomain.com

 

Packages::verify_input_data


 

This event triggers when an account package is added or modified.

Available Stages:

  • pre — Hook action allows for package field input checks and rejects the creation or modification of the package if values do not match desired criteria.
  • post — N/A

Action Code Runs As:

root

Blocking Attribute:

Escalate Privileges Attribute:

N/A

Output parameters

Note:

The chosen stage determines the event's output. Select the appropriate tab to view output parameters for that stage. 

ParameterTypeDescriptionPossible valuesExample
bwlimit string

The hosting plan's maximum bandwidth use.

This parameter defaults to unlimited.

  • A positive integer between one and 999,999 that represents the maximum bandwidth use, in Megabytes (MB).
  • 0unlimited, or null — The account has unlimited bandwidth.

unlimited

cgiBoolean

Whether CGI access is enabled for the account.

This parameter defaults to 1.

  • 1 — Enabled.
  • 0 — Disabled.

y

ip

string

Whether the account has a dedicated IP address.

This parameter defaults to n.

  • y — The account has a dedicated IP address.
  • n — The account does not have a dedicated IP address.

n

maxsubstringThe hosting plan's maximum number of subdomains.
  • unlimited
  • An integer that represents a number of subdomains.
unlimited

maxpop

string

The hosting plan's maximum number of email accounts.

This parameter defaults to unlimited.

  • A positive integer between one and 999,999.
  • 0unlimited, or null — The account has unlimited email accounts.
unlimited
maxlststringThe hosting plan's maximum number of mailing lists.
  • unlimited
  • An integer that represents a number of mailing lists.
unlimited
cpmodstring

The hosting plan's cPanel theme.

This parameter defaults to the server's default cPanel theme.

  • paper_lantern
  • A valid theme on the server.
paper_lantern
languagestring

The hosting plan's default locale.

This value defaults to the server's default locale.

A two-letter ISO-3166 code.en
featureliststringThe hosting plan's feature list.

If you do not use this parameter, the function assigns the default feature list to the hosting plan's accounts.

A valid feature list name on the server.default
maxftpstringThe hosting plan's maximum number of FTP accounts.

This parameter defaults to unlimited.

  • A positive integer between one and 999,999.
  • 0unlimited, or null — The account has unlimited FTP accounts.
unlimited
max_email_per_hourinteger

The maximum number of emails that the account can send in one hour.

This parameter defaults to unlimited.

Note:

This parameter is only available in cPanel & WHM version 11.32 or later. 

 

  • A positive integer.
  • 0 or unlimited — The account can send an unlimited number of emails.
unlimited
maxaddonstring

The hosting plan's maximum number of addon domains.

This parameter defaults to unlimited.

  • A positive integer between one and 999,999.
  • 0unlimited, or null — The account has unlimited addon domains.
0
maxsqlstring

The hosting plan's maximum number of each available type of SQL database.

For example, if you set this value to 5 and the system administrator allows MySQL® and PostgreSQL® databases, users can create up to five MySQL databases and up to five PostgreSQL databases.

This parameter defaults to unlimited.

  • A positive integer between one and 999,999.
  • 0unlimited, or null — The account has unlimited databases.
unlimited
hasshellBoolean 

Whether the account has shell access.

This parameter defaults to 0.

  • 1 — The account has shell access.
  • 0 — No shell access.
n
editstring

Whether the users wishes to modify or add an existing package extension.

 

  • yes — The user wishes to modify an existing package extension.
  • no — The user wishes to add an existing package extension.

Note:

The edit parameter is part of the API call and not included in the package. The system displays yes when a user modifies an existing package extension and no when they wish to add one.

yes
max_defer_fail_percentagesinteger

The percentage of failed or deferred email messages that the account can send per hour before outgoing mail is rate-limited.

Note:

This parameter is only available in cPanel & WHM version 11.32 or later.

  • A positive integer.
  • 0 or unlimited — The account can send an unlimited number of failed or deferred messages.
unlimited
quotaintegerThe hosting plan's disk space quota.

This parameter defaults to 0 (unlimited).

  • A positive integer between one and 999,999 that represents the maximum disk space that the account may use, in Megabytes (MB).
  • 0 — The hosting plan's disk space is unlimited.
unlimited
maxparkstring

The hosting plan's maximum number of parked domains (aliases).

This parameter defaults to unlimited.

  • A positive integer between one and 999,999.
  • 0unlimited, or null — The account has unlimited parked domains.
0
namestringThe hosting plan name.An existing hosting plan name on the server.lvebishes
_package_extensions string

The hosting plan's package extensions.

If you do not provide a value, the hosting plan will not include package extensions.

Note:

This parameter is only available in cPanel & WHM version 11.40 or later.

A space-delimited list of one or more package extensions on the server.

Notes:

  • You can also include the extension's variables in your function call, in key=value format. Consult the extension's documentation for a list of possible variables.
  •  Extension names and variables are case-sensitive.
extension1 extension2 extension3

digestauth

stringWhether to enable Digest Authentication for the account.
    • y — Enable.
    • n — Disable.
n

N/A