Package Account Functions
For cPanel & WHM 11.32
Note: The Standardized Hooks documentation is currently under revision. You should check back shortly for improvements to this information.
This document describes hook insertion points for the
PkgAcct module.
PkgAcct::Create (Pre)
| Namespace |
PkgAcct |
| Function |
Create |
| Stage |
pre |
| Blocking |
Yes |
| Run as... |
During transfers, this function executes as root. When generating backup files, this function is executed as the user to whom the backup file belongs. |
| Description |
Executed before the pkgacct script is run. This function can prevent backups from being created by means of custom code. |
Parameters
{
'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."
};
PkgAcct::Create (preFinalize)
| Namespace |
PkgAcct |
| Function |
Create |
| Stage |
preFinalize |
| Blocking |
No |
| Run as... |
During transfers, this function executes as root. When generating backup files, this function executes as the user to whom the backup file belongs. |
| Description |
Executed before the compression or transfer of the archive occurs. |
Parameters
{
'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. 1 indicates that the archive is an incremental backup."
'is_split' => "A boolean value that indicates whether the archive is split into multiple files. 1 indicates that the archive is split into multiple files."
'is_tarball' => "A boolean value that indicates whether a tarball will be generated. 1 indicates that a tarball will be generated."
'is_backup' => "A boolean value that indicates whether the archive is a backup. 1 indicates that the archive is a backup."
};
PkgAcct::Create (postFinalize)
| Namespace |
PkgAcct |
| Function |
Create |
| Stage |
postFinalize |
| Blocking |
No |
| Run as... |
During transfers, this function executes as root. When generating backup files, this function executes as the user to whom the backup file belongs. |
| Description |
Executed after the compression or transfer of the archive.
Note: This hook is not executed when the skiphomedir parameter is set to 1. |
Parameters
{
'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. 1 indicates that the archive is an incremental backup."
'is_split' => "A boolean value that indicates whether the archive is split into multiple files. 1 indicates that the archive is split into multiple files."
'is_tarball' => "A boolean value that indicates whether a tarball will be generated. 1 indicates that a tarball will be generated."
'is_backup' => "A boolean value that indicates whether the archive is a backup. 1 indicates that the archive is a backup."
};
The following parameters are
not available if
is_split is set to
1 or the
$create_tarball variable is set to
false.
{
'tarball' => "The path to the tarball."
'md5sum' => "The md5sum of the tarball."
'size' => "The size, in bytes, of the tarball."
};
PkgAcct::Restore (preExtract)
| Namespace |
PkgAcct |
| Function |
Restore |
| Stage |
preExtract |
| Blocking |
Yes |
| Run as... |
root |
| Description |
Executed after the cpmove archive is extracted, but before the account is restored. |
Parameters
{
'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 in which the contents of the extracted archive will be stored."
'createacct' => "A boolean value that indicates whether the account should be created. 1 indicates that 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. 1 indicates that email addresses will be restored."
'restoremysql' => "A boolean value that indicates whether MySQL databases will be restored. 1 indicates that MySQL databases will be restored."
'restoresubs' => "A boolean value that indicates whether subdomains will be restored. 1 indicates that subdomains will be restored."
'restorereseller' => "A boolean value that indicates whether reseller privileges will be restored. 1 indicates that reseller privileges will be restored."
'restorepsql' => "A boolean value that indicates whether PostgreSQL databases will be restored. 1 indicates that PostgreSQL databases will be restored."
'restoreparked' => "A boolean value that indicates whether parked domains will be restored. 1 indicates that parked domains will be restored."
'force' => "A boolean value that indicates whether the extraction will be forced. 1 indicates that the extraction will be forced."
'manual' => "A boolean value that indicates whether the restorepkg script will be executed manually. A value of 1 indicates that the script will be executed manually."
'incremental' => "A boolean value that indicates whether the restored archive is an incremental archive. 1 indicates that the archive is an incremental archive."
};
PkgAcct::Restore (postExtract)
| Namespace |
PkgAcct |
| Function |
Restore |
| Stage |
postExtract |
| Blocking |
Yes |
| Run as... |
root |
| Description |
Executed after the archive is extracted, but before it is restored. |
Parameters
{
'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 in which the contents of the extracted archive will be stored."
'createacct' => "A boolean value that indicates whether the account should be created. 1 indicates that 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. 1 indicates that email addresses will be restored."
'restoremysql' => "A boolean value that indicates whether MySQL databases will be restored. 1 indicates that MySQL databases will be restored."
'restoresubs' => "A boolean value that indicates whether subdomains will be restored. 1 indicates that subdomains will be restored."
'restorereseller' => "A boolean value that indicates whether reseller privileges will be restored. 1 indicates that reseller privileges will be restored."
'restorepsql' => "A boolean value that indicates whether PostgreSQL databases will be restored. 1 indicates that PostgreSQL databases will be restored."
'restoreparked' => "A boolean value that indicates whether parked domains will be restored. 1 indicates that parked domains will be restored."
'force' => "A boolean value that indicates whether the extraction should be forced. 1 indicates that the extraction will be forced."
'manual' => "A boolean value that indicates whether the restorepkg script was executed manually. A value of 1 indicates that the script was executed manually."
'incremental' => "A boolean value that indicates whether the restored archive is an incremental archive. 1 indicates that the archive is an incremental archive."
};
PkgAcct::Restore (post)
| Namespace |
PkgAcct |
| Function |
Restore |
| Stage |
post |
| Blocking |
No |
| Run as... |
root |
| Description |
Executed after the archive is extracted and restored. |
Parameters
{
'user' => "The account's username, as it exists on the 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 to which the account was restored."
'createacct' => "A boolean value that indicates whether the account was automatically created. 1 indicates that the account was created automatically, upon extraction."
'ip' => "A boolean value that indicates whether the account uses a dedicated IP address. 1 indicates the account uses a dedicated IP address."
'customip' => "The IP address the account is using."
'restoremail' => "A boolean value that indicates whether email addresses were restored. 1 indicates that email addresses were restored."
'restoremysql' => "A boolean value that indicates whether MySQL databases were restored. 1 indicates that MySQL databases were restored."
'restoresubs' => "A boolean value that indicates whether subdomains were restored. 1 indicates that subdomains were restored."
'restorereseller' => "A boolean value that indicates whether reseller privileges were restored. 1 indicates that reseller privileges were restored."
'restorepsql' => "A boolean value that indicates whether PostgreSQL databases were restored. 1 indicates that PostgreSQL databases were restored."
'restoreparked' => "A boolean value that indicates whether parked domains were restored. 1 indicates that parked domains were restored."
'force' => "A boolean value that indicates whether the extraction was forced. 1 indicates that the extraction was forced."
'manual' => "A boolean value that indicates whether the restorepkg script was executed manually. A value of 1 indicates that the script was executed manually."
'incremental' => "A boolean value that indicates whether the restored archive was an incremental archive. 1 indicates that the archive was an incremental archive."
};
Topic revision: r11 - 20 Jan 2012 - 16:50:41 - Main.JustinSchaefer
SoftwareDevelopmentKit.StndHooksPkgAcctFunctions moved from Sandbox.StndHooksPkgAcctFunctions on 01 Nov 2011 - 21:27 by Main.JustinSchaefer -
put it back