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

Account Packaging, Backups, and Transfers Functions — PkgAcct

PkgAcct::Create

Stage: pre — This hookable event is run before any user data is collected or written by the pkgacct script.

Blocking Attribute: Yes
Escalate Privilege Attribute: No
Action Code Runs As: During transfers, this is run as root. When generating backup files, the script runs as the user to whom the backup belongs.
Data:
{
    'workdir' => "The temporary working directory used to build the cpmove archive.",
    'homedir' => "The user's home directory.",
    'user'    => "The user for whom the backup or transfer process is being performed.",
}


Stage: preFinalized — This hookable event is run before the compression or transfer of an archive occurs.

Blocking Attribute: Yes
Escalate Privilege Attribute: No
Action Code Runs As: During transfers, this is run as root. When generating backup files, the script runs as the user to whom the backup belongs.
Data:
{
    'workdir' => "The temporary working directory used to build the cpmove archive.",
    'homedir' => "The user's home directory.",
    'user' => "The user for whom the backup or transfer process is being performed.",
    'is_incremental' => "A boolean value that indicates whether the archive is an incremental backup.",
    'is_split' => "A boolean value that indicates that the archive is split into multiple files.",
    'is_tarball' => "A boolean value that indicates if a tarball will be generated.",
    'is_backup' => "A boolean value that indicates that the archive is a backup.",
}


Stage: postFinalized — This hookable event is run after the compression or transfer of an archive occurs. This hook stage will not occur if the skiphomedir parameter is set to 1.

Blocking Attribute: Yes
Escalate Privilege Attribute: No
Action Code Runs As: During transfers, this is run as root. When generating backup files, the script runs as the user to whom the backup belongs.
Data:
{
    'workdir' => "The temporary working directory used to build the cpmove archive.",
    'homedir' => "The user's home directory.",
    'user' => "The user for whom the backup or transfer process is being performed.",
    'is_incremental' => "A boolean value that indicates whether or not the archive is an incremental backup.",
    'is_split' => "A boolean value that indicates whether the archive is split into multiple files.",
    'is_tarball' => "A boolean value that indicates whether a tarball will be generated."
    'is_backup' => "A boolean value that indicates that the archive is a backup."
    'tarball' => "The path to the tarball. Not present if 'is_split' is 1 or the `pkgacct` variable $create_tarball is set to 'false'.",
    'md5sum' => "The md5sum of the tarball. Not present if 'is_split' is 1 or the `pkgacct` variable $create_tarball is set to 'false'.",
    'size' => "The size, in bytes, of the tarball. Not present if 'is_split' is 1 or the `pkgacct` variable $create_tarball is set to 'false'.",
}

PkgAcct::Restore

Stage: preExtract — This hookable event is run before the account archive is extracted.

Blocking Attribute: Yes
Escalate Privilege Attribute: N/A
Action Code Runs As: root
Data:
{
    'user' => "The account's username, as it will exist on the new system.",
    'olduser' => "The account's username, as it existed on the old system.",
    'file' => "The path to the archive to extract.",
    'extractname' => "The filename of the archive to extract.",
    'dir' => "The directory where the contents of the extracted archive will be stored.",
    'createacct' => "A boolean value that indicates whether the account should be created.",
    'ip' => "A boolean value that indicates whether the account should be assigned a dedicated IP address.",
    'customip' => "The IP address that the account will use when it is fully restored.",
    'restoremail' => "A boolean value that indicates whether email addresses will be restored.",
    'restoremysql' => "A boolean value that indicates whether MySQL databases will be restored.",
    'restoresubs' => "A boolean value that indicates whether subdomains will be restored.",
    'restorereseller' => "A boolean value that indicates whether reseller privileges will be restored.",
    'restorepsql' => "A boolean value that indicates whether PostgreSQL databases will be restored.",
    'restoreparked' => "A boolean value that indicates whether parked domains will be restored.",
    'force' => "A boolean value that indicates whether the extraction will be forced.",
    'manual' => "A boolean value that indicates whether the restorepkg script will be executed manually.",
    'incremental' => "A boolean value that indicates whether the restored archive is an incremental archive.",
} 


Stage: postExtract — This hookable event is run after the account archive is extracted, but prior to its restoration.

Blocking Attribute: Yes
Escalate Privilege Attribute: N/A
Action Code Runs As: root
Data:
{
    'user' => "The account's username, as it will exist on the new system.",
    'olduser' => "The account's username, as it existed on the old system.",
    'file' => "The path to the archive to extract.",
    'extractname' => "The filename of the archive to extract.",
    'dir' => "The directory where the contents of the extracted archive will be stored.",
    'createacct' => "A boolean value that indicates whether the account should be created.",
    'ip' => "A boolean value that indicates whether the account should be assigned a dedicated IP address.",
    'customip' => "The IP address that the account will use when it is fully restored.",
    'restoremail' => "A boolean value that indicates whether email addresses will be restored.",
    'restoremysql' => "A boolean value that indicates whether MySQL databases will be restored.",
    'restoresubs' => "A boolean value that indicates whether subdomains will be restored.",
    'restorereseller' => "A boolean value that indicates whether reseller privileges will be restored.",
    'restorepsql' => "A boolean value that indicates whether PostgreSQL databases will be restored.",
    'restoreparked' => "A boolean value that indicates whether parked domains will be restored.",
    'force' => "A boolean value that indicates whether the extraction will be forced.",
    'manual' => "A boolean value that indicates whether the restorepkg script was executed manually.",
    'incremental' => "A boolean value that indicates whether the restored archive is an incremental archive.",
}


Stage: post — This hookable event is run after the account is restored.

Blocking Attribute: Yes
Escalate Privilege Attribute: N/A
Action Code Runs As: root
Data:
{
    'user' => "The account's username, as it exists on the new system.",
    'olduser' => "The account's username, as it existed on the old system.",
    'file' => "The path to the extracted archive.",
    'extractname' => "The filename of the archive that was extracted.",
    'dir' => "The directory where the extracted archive was restored.",
    'createacct' => "A boolean value that indicates whether the account was created.",
    'ip' => "A boolean value that indicates whether the account was assigned a dedicated IP address.",
    'customip' => "The IP address that the account is using.",
    'restoremail' => "A boolean value that indicates whether email addresses were restored.",
    'restoremysql' => "A boolean value that indicates whether MySQL databases were restored.",
    'restoresubs' => "A boolean value that indicates whether subdomains were restored.",
    'restorereseller' => "A boolean value that indicates whether reseller privileges were restored.",
    'restorepsql' => "A boolean value that indicates whether PostgreSQL databases were restored.",
    'restoreparked' => "A boolean value that indicates whether parked domains were restored.",
    'force' => "A boolean value that indicates whether the extraction was forced.",
    'manual' => "A boolean value that indicates whether the restorepkg script was executed manually.",
    'incremental' => "A boolean value that indicates whether the restored archive was an incremental archive.",
}

Topic revision: r3 - 12 Mar 2012 - 20:46:41 - Main.JustinSchaefer
SoftwareDevelopmentKit.StdPackageAcctsFunctions moved from Sandbox.StdPackageAcctsFunctions on 12 Mar 2012 - 20:46 by Main.JustinSchaefer - put it back