Guide to Standardized Hooks - Whostmgr Functions

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. 

Pre & Post

Parameter
Type
Description
Possible values
Example
cur_pkg string

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

A valid hosting plan name. oldpackagename
new_pkg string

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

A valid hosting plan name.

newpackagename
user string The user for whom the package will change. 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. 

Pre

Parameter

Type

Description

Possible values

Example

new_shell

string

The new shell setting.

  • noshell
  • nologin
  • false
  • shutdown
  • sync

noshell

 current_shell 

string

The current shell setting.

  • noshell
  • nologin
  • false
  • shutdown
  • sync

nologin

user

 string 

 The account for which shell settings will change. 

 A valid username on the server. 

 username 

 Post

Parameter

Type

Description

Possible values

Example

new_shell

string

The new shell setting.

  • noshell
  • nologin
  • false
  • shutdown
  • sync

noshell

 current_shell 

string

The previous shell setting.

  • noshell
  • nologin
  • false
  • shutdown
  • sync

nologin

user

string

 The account for which shell settings changed. 

 A valid username on the server. 

username

rawout

 string 

Additonal 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. 

Pre

 Parameter 

Type

Description

Possible values

Example

user

string

The account to suspend.

A valid username on the server.

username

reason

string

The reason for suspension, if one exists.

A string value.

 Nonpayment 

disallowun

 boolean 

 Whether resellers can unsuspend the account. 

  • 1 — Resellerscannotunsuspend the account.
  • 0 — Resellerscan unsuspend the account.

1

Post

 

 Parameter 

Type

Description

Possible values

Example

user

string

The suspended account.

A valid username on the server.

username

reason

string

The reason for suspension, if one exists.

A string value.

 Nonpayment 

disallowun

 boolean 

 Whether resellers can unsuspend the account. 

  • 1 — Resellers cannotunsuspend the account. 
  • 0 — Resellers can unsuspend the account.

1

rawout

string

The 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. 

Pre

 Parameter 

Type

Description

Possible values

Example

user

 string 

 The account to unsuspend. 

 A valid username on the server. 

 username 

 
Post

 

 Parameter 

Type

Description

Possible values

Example

user

 string 

 The unsuspended account. 

 A valid username on the server. 

username

rawout

string

The event's raw output.

A string value.

 raw output 

 

 

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'sLangPHP::php_ini_set_user_contentfunction 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 is only available in cPanel & WHM version 56 or later.
  • When you hook this event, you must also hook UAPI'sLangPHP::php_ini_set_user_basic_directivesfunction to ensure consistent behavior.

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 mustalso hook UAPI'sLangPHP::php_set_vhost_versionsfunction 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.

 

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. 

Pre

Parameter

Type

Description

Possible values

Example

user

string

The cPanel account that owns the domains.

 A valid username on the server. 

username

 target_domain 

string

 The domain on which to park thenew_domaindomain. 

A valid domain.

example.com

new_domain

 string 

The domain to park on thetarget_domaindomain.

A valid domain.

 parkeddomain.com 

 Post

Parameter

Type

Description

Possible values

Example

user

string

The cPanel account that owns the domains.

 A valid username on the server. 

username

 target_domain 

string

The domain on which the system parked thenew_domaindomain.

A valid domain.

example.com

new_domain

 string 

 The domain that the system parked on thetarget_domaindomain. 

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:

  • 0 Users Found This Useful
  • Was this answer helpful?

    Related Articles

    The cPanel Interface

    For  cPanel  &  WHM  version  58 Overview The cPanel interface is...

    User Preferences

    For cPanel & WHM version 58 Overview This document outlines how to access your cPanel...

    Manage External Authentications

    For cPanel & WHM version 58 Overview Manage credentials Additional documentation...

    What is cPanelID?

    In This Article:  Overview ServicesHow to get a cPanelID cPanelID External...

    Guide to cPanel Interface Customization - cPanel Style Development

    Introduction You can develop custom styles that modify the appearance of the cPanel interface....