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

WHM Functions

For cPanel & WHM 11.32

noteNote: The Standardized Hooks documentation is currently under revision. You should check back shortly for improvements to this information.

This document covers hook insertion points for WHM functions.

Whostmgr::Account::Create (pre)

Namespace Whostmgr
Function Accounts::Create
Stage pre
Blocking Yes
Run as... root
Description Executed before an account is created.

Parameters

{
    'user' => "The user to modify."
    'domain' => "The account's new main domain name."
    'plan' => "Package to use for account creation."
    'pkgname' => "This parameter allows you to specify a package name if you wish to store the settings used to create the account as a package. If you specify a string here, you should set the savepkg parameter to 1."
    'savepkg' => "A boolean value that determines whether to save the settings as a new package. 1 indicates that the package should be saved. If you set this value to 1, you should be sure to specify a string in the pkgname parameter."
    'featurelist => "The name of the package the new account should use."
    'quota' => "The account's disk space quota in Megabytes. A value of 0 results in the an unlimited disk space quota."
    'password' => "The password for the new cPanel account."
    'ip' => "Indicates whether the account has a dedicated IP address. A value of 'y' indicates that the account will have a dedicated IP address, while a value of 'n' indicates that the account does not have a dedicated IP address."
    'cgi' => "A boolean value that indicates whether the account has CGI access. 1 indicates that the account has CGI access."
    'frontpage' => "A boolean value that indicates whether the domain has FrontPage extensions installed. 1 indicates that the domain can use FrontPage extensions."
    'hasshell' => "A boolean value that indicates whether the domain has shell/SSH access. 1 indicates that the account has access to a shell."
    'contactemail' => "The account's contact email address."
    'cpmod' => "The cPanel theme name, usually x3."
    'maxftp' => "The maximum number of FTP accounts the account can have at one time. 0 indicates that the account can use an unlimited number of FTP accounts."
    'maxsql' => "The maximum number of databases the account is able to create, per type. For example, if you enter 10, and both MySQL and PostgreSQL are installed, the user can create 10 MySQL and 10 PostgreSQL databases. 0 indicates that the account can use an unlimited number of databases."
    'maxpop' => "The maximum number of email accounts the account can have at one time. 0 indicates that the account can use an unlimited number of email addresses."
    'maxlst' => "The maximum number of mailing lists the account can have at one time. 0 indicates that the account can use an unlimited number of mailing lists."
    'maxsub' => "The maximum number of subdomains the account can have at one time. 0 indicates that the account can use an unlimited number of subdomains."
    'maxpark' => "The maximum number of parked domains the account can have at one time. 0 indicates that the account can use an unlimited number of parked domains."
    'maxaddon' => "The maximum number of addon domains the account can have at one time. 0 indicates that the account can use an unlimited number of addon domains."
    'bwlimit' => "The account's bandwidth limit in Megabytes. 0 indicates that the account can use an unlimited amount of bandwidth."
    'customip' => "The account's IP address."
    'language' => "The language (locale) in which the cPanel interface appears."
    'useregns' => "A boolean value that indicates whether to use the registered nameservers for the domain instead of the ones configured on the server. 1 indicates that the nameservers registered at the registrar will be used."
    'hasuseregns' => "If the account is using nameservers specified at the registrar, this value should be set to 1."
    'reseller' => "A boolean value that indicates whether the account is a reseller. 1 indicates that the account is a reseller account."
    'forcedns' => "A boolean value that indicates whether to overwrite the current DNS zone, if a DNS zone already exists. 1 indicates that current DNS zones should be overwritten."
    'mxcheck' => "Determines how the server will handle incoming mail for this domain. This variable can be set to 'local', 'secondary', 'remote', or 'auto'.
};

Whostmgr::Accounts::Create (post)

Namespace Whostmgr
Function Accounts::Create
Stage post
Blocking No
Run as... root
Description Executed after an account is created.

Parameters


{
    'user' => "The user to modify."
    'domain' => "The account's new main domain name."
    'plan' => "Package to use for account creation."
    'pkgname' => "The name of a new package to be created based on the settings used."
    'savepkg' => "A boolean value that determines whether to save the settings as a new package. 1 indicates that the package should be saved."
    'featurelist => "The name of the feature list to use when creating a new package."
    'quota' => "The account's disk space quota in Megabytes. A value of 0 results in the an unlimited disk space quota."
    'password' => The password for the new cPanel account."
    'ip' => "Indicates whether the account has a dedicated IP address. A value of 'y' indicates that the account will have a dedicated IP address, while a value of 'n' indicates that the account does not have a dedicated IP address."
    'cgi' => "A boolean value that indicates whether the account has CGI access. 1 indicates that the account has CGI access."
    'frontpage' => "A boolean value that indicates whether the domain has FrontPage extensions installed. 1 indicates that the domain can use FrontPage extensions."
    'hasshell' => "A boolean value that indicates whether the domain has shell/SSH access. 1 indicates that the account has access to a shell."
    'contactemail' => "The account's contact email address."
    'cpmod' => "The cPanel theme name."
    'maxftp' => "The maximum number of FTP accounts the account can have at one time. 0 indicates that the account can use an unlimited number of FTP accounts."
    'maxsql' => "The maximum number of databases the account can create, per type. For example, if you enter 10, and both MySQL and PostgreSQL are installed, the user can create 10 MySQL and 10 PostgreSQL databases. 0 indicates that the account can use an unlimited number of databases."
    'maxpop' => "The maximum number of email accounts the account can have at one time. 0 indicates that the account can use an unlimited number of email addresses."
    'maxlst' => "The maximum number of mailing lists the account can have at one time. 0 indicates that the account can use an unlimited number of mailing lists."
    'maxsub' => "The maximum number of subdomains the account can have at one time. 0 indicates that the account can use an unlimited number of subdomains."
    'maxpark' => "The maximum number of parked domains the account can have at one time. 0 indicates that the account can use an unlimited number of parked domains."
    'maxaddon' => "The maximum number of addon domains the account can have at one time. 0 indicates that the account can use an unlimited number of addon domains."
    'bwlimit' => "The account's bandwidth limit in Megabytes. 0 indicates that the account can use an unlimited amount of bandwidth."
    'customip' => "The account's IP address."
    'language' => "The language (locale) in which the cPanel interface appears."
    'useregns' => "A boolean value that indicates whether to use the registered nameservers for the domain instead of the ones configured on the server. 1 indicates that the nameservers registered at the registrar will be used."
    'hasuseregns' => "If the account is using nameservers specified at the registrar, this value should be set to 1."
    'reseller' => "A boolean value that indicates whether the account is a reseller. 1 indicates that the account is a reseller account."
    'forcedns' => "A boolean value that indicates whether to overwrite a current DNS zone, if a DNS zone already exists. 1 indicates that current DNS zones should be overwritten."
    'mxcheck' => "Determines how the server will handle incoming mail for this domain. This variable can be set to 'local', 'secondary', 'remote', or 'auto'.
};

Whostmgr::Accounts::Modify (pre)

Namespace Whostmgr
Function Accounts::Modify
Stage pre
Blocking Yes
Run as... root
Description Executed before an account is modified.

Parameters

{

    'user' => "The user to modify."
    'domain' => "The account's new main domain name."
    'newuser' => "The new username for the account."
    'owner' => "The account's new owner."
    'CPTHEME' => "The account's new theme."
    'HASCGI' => "Indicates whether the account should have access to CGI. 1 indicates that the account should have CGI access."
    'LANG' => "The account's new language (locale)."
    'MAXFTP' => "The maximum number of FTP accounts the account can have at one time. 0 indicates that the account can have an unlimited number FTP accounts."
    'MAXSQL' => "The maximum number of SQL databases the account can have at one time, per type. For example, if you enter 10, and both MySQL and PostgreSQL are installed, the user can create 10 MySQL and 10 PostgreSQL databases. 0 indicates that the account can have an unlimited number of SQL databases."
    'MAXPOP' => "The maximum number of email accounts the account can have at one time. 0 indicates that the account can have an unlimited number of email accounts."
    'MAXLST' => "The maximum number of mailing lists the account can have at one time. 0 indicates that the account can have an unlimited number of mailing lists."
    'MAXSUB' => "The maximum number of subdomains the account can have at one time. 0 indicates that the account can have an unlimited number of subdomains."
    'MAXPARK' => "The maximum number of parked domains accounts the account can have at one time. 0 indicates that the account can have an unlimited number of parked domains."
    'MAXADDON' => "The maximum number of addon domains the account can have at one time. 0 indicates that the account can have an unlimited number of addon domains."
    'shell' => "A boolean value that indicates whether the account has shell access. 1 indicates that the account has shell access."

};

These parameters are the same as the parameters to the XML API's modifyacct function. Only parameters that are specified are used in the hook.

Whostmgr::Accounts::Modify (pre)

Namespace Whostmgr
Function Accounts::Modify
Stage post
Blocking No
Run as... root
Description Executed after an account is modified.

Parameters

{

    'user' => "The user to modify."
    'domain' => "The account's new main domain name."
    'newuser' => "The new username for the account."
    'owner' => "The account's new owner."
    'CPTHEME' => "The account's new theme."
    'HASCGI' => "Indicates whether the account should have access to CGI. 1 indicates that the account should have CGI access."
    'LANG' => "The account's new language (locale)."
    'MAXFTP' => "The maximum number of FTP accounts the account can have at one time. 0 indicates that the account can have an unlimited number of FTP accounts."
    'MAXSQL' => "The maximum number of SQL databases the account can have at one time, per type. For example, if you enter 10, and both MySQL and PostgreSQL are installed, the user can create 10 MySQL and 10 PostgreSQL databases. 0 indicates that the account can have an unlimited number of SQL databases."
    'MAXPOP' => "The maximum number of email accounts the account can have at one time. 0 indicates that the account can have an unlimited number of email accounts."
    'MAXLST' => "The maximum number of mailing lists the account can have at one time. 0 indicates that the account can have an unlimited number of mailing lists."
    'MAXSUB' => "The maximum number of subdomains the account can have at one time. 0 indicates that the account can have an unlimited number of subdomains."
    'MAXPARK' => "The maximum number of parked domains accounts the account can have at one time. 0 indicates that the account can have an unlimited number of parked domains."
    'MAXADDON' => "The maximum number of addon domains the account can have at one time. 0 indicates that the account can have an unlimited number of addon domains."
    'shell' => "A boolean value that indicates whether the account has shell access. 1 indicates that the account has shell access."

};

Whostmgr::Accounts::Remove (pre)

Namespace Whostmgr
Function Accounts::Remove
Stage pre
Blocking Yes
Run as... root
Description Executed before an account is removed.

Parameters


{
    'user' => "The name of the account to remove."
    'keepdns' => "An optional integer variable that indicates whether DNS entries for the domain should be kept after the account is removed. '1' indicates that the DNS entries should be removed. '2' indicates that the DNS entries should not be removed."
};

Whostmgr::Accounts::Remove (pre)

Namespace Whostmgr
Function Accounts::Remove
Stage post
Blocking No
Run as... root
Description Executed after an account is removed.


{
    'user' => "The name of the account that was removed."
    'keepdns' => "An integer value that indicates whether DNS entries for the domain were removed when the account was removed. '1' indicates that the DNS entries were removed. '2' indicates that the DNS entries were not removed."
};

Whostmgr::Accounts::set_shell (pre)

Namespace Whostmgr
Function Accounts::set_shell
Stage pre
Blocking Yes
Run as... root
Description Executed before an account's access to a shell is altered.


{
    'new_shell'    => "A string value that indicates what kind of shell access the account should have. Possible values include 'noshell', 'nologin', 'false', 'shtudown', 'sync'."
    'current_shell' => "A string value that indicates what kind of shell access the account had."
    'user'          => "The username to affect."
};

Whostmgr::Accounts::set_shell (post)

Namespace Whostmgr
Function Accounts::set_shell
Stage post
Blocking No
Run as... root
Description Executed after an account's access to a shell is altered.


{

    'current_shell' => "A string value that indicates what kind of shell access the account had. Possible values include 'noshell', 'nologin', 'false', 'shtudown', 'sync'."
    'new_shell' => "A string value that indicates the kind of shell access the account will use. Possible values include 'noshell', 'nologin', 'false', 'shtudown', 'sync'."
    'user'          => "The username to affect."
    'rawout'        => "Any raw output from the password change operation."
};

Topic revision: r13 - 20 Jan 2012 - 16:50:46 - Main.JustinSchaefer
SoftwareDevelopmentKit.StndHooksWHMFunctions moved from Sandbox.StndHooksWHMFunctions on 01 Nov 2011 - 21:27 by Main.JustinSchaefer - put it back