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

WHM Functions — Whostmgr

Accounts::change_package

Stage: pre — This hookable event is run before an account is created.

Blocking Attribute: Yes
Escalate Privilege Attribute: N/A
Action Code Runs As: root
Data:

{
    'cur_pkg' => "The name of the previously-set package for the user",
    'new_pkg' => "The name of the new package that will be assigned to the user",
    'user'    => "The username of the user whose package will be altered",
}


Stage: post — This hookable event is run after an account is created.

Blocking Attribute: No
Escalate Privilege Attribute: N/A
Action Code Runs As: root
Data:

{
    'cur_pkg' => "The name of the previously-set package for the user",
    'new_pkg' => "The name of the new package assigned to the user",
    'user'    => "The username of the user that has been altered",
}

Accounts::Create

Stage: pre — This hookable event is run before an account is created.

Blocking Attribute: Yes
Escalate Privilege Attribute: N/A
Action Code Runs As: root
Data:

{
    'user' => "The user create.",
    'domain' => "The account's new main domain name.",
    'plan' => "Package to use for account creation.",
    'pkgname' => "A new package name to associate the various settings provided. Only applicable if the savepkg parameter is set to 1.",
    'savepkg' => "A boolean value that indicates whether to save the settings as a new package. See 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 should have a dedicated IP address. A value of 'y'  for yes or ‘n’ for no.",
    '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 if FrontPage extensions should be installed for the domain.",
    '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 an unlimited number of FTP accounts.",
    'maxsql' => "The maximum number of databases the account is able to create, per RDBM type. 0 indicates an unlimited number of databases.",
    'maxpop' => "The maximum number of email accounts the account can have at one time. 0 indicates an unlimited number of email addresses.",
    'maxlst' => "The maximum number of mailing lists the account can have at one time. 0 indicates an unlimited number of mailing lists.",
    'maxsub' => "The maximum number of subdomains the account can have at one time. 0 indicates an unlimited number of subdomains.",
    'maxpark' => "The maximum number of parked domains the account can have at one time. 0 indicates an unlimited number of parked domains.",
    'maxaddon' => "The maximum number of addon domains the account can have at one time. 0 indicates 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 which nameserver to use. 0 for local server or 1 for nameservers according to domain's registrar.",
    '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 it already exists.",
    'mxcheck' => "Determines how the server will handle incoming mail for this domain. Valid values are: 'local', 'secondary', 'remote', or 'auto'.",
}


Stage: post — This hookable event is run after an account is created.

Blocking Attribute: Yes
Escalate Privilege Attribute: N/A
Action Code Runs As: root
Data:

{
    'user' => "The username that was created.",
    'domain' => "The account's new main domain name.",
    'plan' => "Package used for account creation.",
    'pkgname' => "A new package name to associate the various settings provided. Only applicable if the savepkg parameter to 1.",
    'savepkg' => "A boolean value that indicate whether to save the settings as a new package. See the pkgname parameter.",
    'featurelist’ => "The name of the package the new account is using.",
    '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 uses a dedicated IP address. A value of 'y'  for yes or ‘n’ for no.",
    '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 if FrontPage extensions were installed for the domain.",
    '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 an unlimited number of FTP accounts.",
    'maxsql' => "The maximum number of databases the account is able to create, per RDBM type. 0 indicates an unlimited number of databases.",
    'maxpop' => "The maximum number of email accounts the account can have at one time. 0 indicates an unlimited number of email addresses.",
    'maxlst' => "The maximum number of mailing lists the account can have at one time. 0 indicates an unlimited number of mailing lists.",
    'maxsub' => "The maximum number of subdomains the account can have at one time. 0 indicates an unlimited number of subdomains.",
    'maxpark' => "The maximum number of parked domains the account can have at one time. 0 indicates an unlimited number of parked domains.",
    'maxaddon' => "The maximum number of addon domains the account can have at one time. 0 indicates 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 which nameserver to use. 0 for local server or 1 for nameservers according to domain's registrar.",
    '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 it already exists.",
    'mxcheck' => "Determines how the server will handle incoming mail for this domain. Valid values are: 'local', 'secondary', 'remote', or 'auto'.",
}

Accounts::Modify

Stage: pre — This hookable event is run before an account is modified.

Blocking Attribute: Yes
Escalate Privilege Attribute: N/A
Action Code Runs As: root
Data:

{
    'owner' => "The account's new owner.",
    'MAXFTP' => "The maximum number of FTP accounts the account can have at one time. 0 indicates an unlimited number of FTP accounts.",
    'HASCGI' => "Indicates whether the account should have access to CGI. 1 indicates that the account should have CGI access.",
    'MAXSUB' => "The maximum number of subdomains the account can have at one time. 0 indicates an unlimited number of subdomains.",
    'MAXADDON' => "The maximum number of addon domains the account can have at one time. 0 indicates unlimited.",
    'MAXLST' => "The maximum number of mailing lists the account can have at one time. 0 indicates an unlimited number of mailing lists.",
    'MAXPARK' => "The maximum number of parked domains the account can have at one time. 0 indicates unlimited.",
    'domain' => "The account's new main domain name.",
    'newuser' => "The new username for the account.",
    'CPTHEME' => "The account's new theme.",
    'user' => "The user to modify.",
    'MAXSQL' => "The maximum number of databases the account is able to create, per RDBM type. 0 indicates an unlimited number of databases.",
    'MAXPOP' => "The maximum number of email accounts the account can have at one time. 0 indicates an unlimited number of email addresses.",
    'shell' => "A boolean value that indicates whether the account has shell access. 1 indicates that the account has shell access.",
    'LANG' => "The account's new language (locale)."
}


Stage: post — This hookable event is run after an account is modified.

Blocking Attribute: Yes
Escalate Privilege Attribute: N/A
Action Code Runs As: root
Data:

{
    'owner' => "The account's new owner.",
    'MAXFTP' => "The maximum number of FTP accounts the account can have at one time. 0 indicates an unlimited number of FTP accounts.",
    'HASCGI' => "Indicates whether the account should have access to CGI. 1 indicates that the account should have CGI access.",
    'MAXSUB' => "The maximum number of subdomains the account can have at one time. 0 indicates an unlimited number of subdomains.",
    'MAXADDON' => "The maximum number of addon domains the account can have at one time. 0 indicates unlimited.",
    'MAXLST' => "The maximum number of mailing lists the account can have at one time. 0 indicates an unlimited number of mailing lists.",
    'MAXPARK' => "The maximum number of parked domains the account can have at one time. 0 indicates unlimited.",
    'domain' => "The account's new main domain name.",
    'newuser' => "The new username for the account.",
    'CPTHEME' => "The account's new theme.",
    'user' => "The user to modify.",
    'MAXSQL' => "The maximum number of databases the account is able to create, per RDBM type. 0 indicates an unlimited number of databases.",
    'MAXPOP' => "The maximum number of email accounts the account can have at one time. 0 indicates an unlimited number of email addresses.",
    'shell' => "A boolean value that indicates whether the account has shell access. 1 indicates that the account has shell access.",
    'LANG' => "The account's new language (locale)."
}

Accounts::Remove

Stage: pre — This hookable event is run before an account is terminated.

Blocking Attribute: Yes
Escalate Privilege Attribute: N/A
Action Code Runs As: root
Data:

{
    'user' => "The name of the account to remove.",
    'keepdns' => "An integer that indicates whether DNS entries for the domain should be kept after the account is removed. 0 indicates the DNS entries will be removed.",
}


Stage: post — This hookable event is run after an account is terminated.

Blocking Attribute: Yes
Escalate Privilege Attribute: N/A
Action Code Runs As: root
Data:

{
    'user' => "The name of the account to remove.",
    'keepdns' => "An integer that indicates whether DNS entries for the domain should be kept after the account is removed. 0 indicates the DNS entries were removed.",
}

Accounts::set_shell

Stage: pre — This hookable event is run before an account's shell is altered.

Blocking Attribute: Yes
Escalate Privilege Attribute: N/A
Action Code Runs As: root
Data:
{
    'new_shell' => "A string that indicates the new shell setting. Valid values are 'noshell', 'nologin', 'false', 'shutdown', 'sync'."
    'current_shell' => "A string that indicates what kind of shell access is currently assigned to the account."
    'user' => "The username to affect."
}


Stage: post — This hookable event is run after an account's shell is altered.

Blocking Attribute: Yes
Escalate Privilege Attribute: N/A
Action Code Runs As: root
Data:
{
    'new_shell' => "A string that indicates the new shell setting. Valid values are 'noshell', 'nologin', 'false', 'shutdown', 'sync'."
    'current_shell' => "A string that indicates what kind of shell access was previously assigned to the account."
    'user' => "The username to affect."
    'rawout' => "Any raw output from the password change operation."
}

Topic revision: r5 - 12 Nov 2012 - 18:48:09 - Main.LaurenceSimon
SoftwareDevelopmentKit.StdWHMFunctions moved from Sandbox.StdWHMFunctions on 12 Mar 2012 - 20:46 by Main.JustinSchaefer - put it back