diff --git a/.gitignore b/.gitignore index e69de29..427ec6b 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +.autogit \ No newline at end of file diff --git a/CHANGELOG b/CHANGELOG new file mode 100644 index 0000000..6450fd8 --- /dev/null +++ b/CHANGELOG @@ -0,0 +1,12 @@ +# Changelog +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [221019] - 2019-10-22 +Added: +- webspace_del for api 1.6.3.2 to fix a bug when deleting a subscription with ipv6 support. +EXTWHMCS-33: +- in module option, now we have the hosting type, this option fix the bug so you can select in whmcs the hosting type. +- fixed various webspace_add.tpl to support hosting type 'none' and 'vrt_hst'. diff --git a/lang/english.php b/lang/english.php index db07036..62ffe91 100644 --- a/lang/english.php +++ b/lang/english.php @@ -8,6 +8,8 @@ "CONFIG_WHICH_IP_ADDRESSES" => "Which IP addresses to use?", "CONFIG_POWER_USER_MODE" => "Use Power User view", "CONFIG_POWER_USER_MODE_DESCRIPTION" => "(Parallels Plesk 12+ only)", + "CONFIG_HOSTING_TYPE" => "Hosting type for Service Plan", + "CONFIG_HOSTING_TYPE_DESCRIPTION" => "Switch to the appropriate hosting type as you selected in plesk; EXAMPLE: 'none' for a mail only service", "FIELD_CHANGE_PASSWORD_MAIN_PACKAGE_DESCR" => "Please pay attention that username/password shown above are used for system/FTP user only and can be used to log in to the Panel.", "FIELD_CHANGE_PASSWORD_ADDITIONAL_PACKAGE_DESCR" => "Please pay attention that username/password shown above are used for system/FTP user only and can't be used to log in to the Panel. You should use username/password pair from package '@PACKAGE@' instead of them.", "ERROR_COMMON_MESSAGE" => "Error code: @CODE@. Error message: @MESSAGE@", diff --git a/lib/Plesk/Manager/V1000.php b/lib/Plesk/Manager/V1000.php index 0a080dd..5648d3a 100644 --- a/lib/Plesk/Manager/V1000.php +++ b/lib/Plesk/Manager/V1000.php @@ -298,7 +298,7 @@ protected function _addWebspace($params) 'username' => $params['username'], 'password' => $params['password'], 'status' => Plesk_Object_Webspace::STATUS_ACTIVE, - 'htype' => Plesk_Object_Webspace::TYPE_VRT_HST, + 'htype' => $params['configoption5'], 'planName' => $params['configoption1'], 'ipv4Address' => $params['ipv4Address'], 'ipv6Address' => $params['ipv6Address'], diff --git a/lib/Plesk/Manager/V1630.php b/lib/Plesk/Manager/V1630.php index 40b6ec7..553ef7f 100644 --- a/lib/Plesk/Manager/V1630.php +++ b/lib/Plesk/Manager/V1630.php @@ -213,20 +213,7 @@ protected function _addAccount($params) protected function _addWebspace($params) { - $this->_checkRestrictions($params); - - $requestParams = [ - 'domain' => $params['domain'], - 'ownerId' => $params['ownerId'], - 'username' => $params['username'], - 'password' => $params['password'], - 'status' => Plesk_Object_Webspace::STATUS_ACTIVE, - 'htype' => Plesk_Object_Webspace::TYPE_VRT_HST, - 'planName' => $params['configoption1'], - 'ipv4Address' => $params['ipv4Address'], - 'ipv6Address' => $params['ipv6Address'], - ]; - Plesk_Registry::getInstance()->api->webspace_add($requestParams); + parent::_addWebspace($params); } protected function _setResellerStatus($params) diff --git a/lib/Plesk/Manager/V1632.php b/lib/Plesk/Manager/V1632.php index 7570cb9..87330c2 100644 --- a/lib/Plesk/Manager/V1632.php +++ b/lib/Plesk/Manager/V1632.php @@ -13,6 +13,11 @@ protected function _addWebspace($params) parent::_addWebspace($params); } + protected function _deleteWebspace($params) + { + parent::_deleteWebspace($params); + } + protected function _getSharedIpv4($params) { return $this->_getIp($params); diff --git a/lib/Plesk/Object/Webspace.php b/lib/Plesk/Object/Webspace.php index 40b67cd..55693e7 100644 --- a/lib/Plesk/Object/Webspace.php +++ b/lib/Plesk/Object/Webspace.php @@ -4,6 +4,4 @@ class Plesk_Object_Webspace { const STATUS_ACTIVE = 0; - - const TYPE_VRT_HST = 'vrt_hst'; } diff --git a/plesk.php b/plesk.php index ee3e2a3..f31f61c 100644 --- a/plesk.php +++ b/plesk.php @@ -77,6 +77,14 @@ function plesk_ConfigOptions(array $params) "Type" => "yesno", "Description" => $translator->translate("CONFIG_POWER_USER_MODE_DESCRIPTION"), ), + "hostingType" => array( + "FriendlyName" => $translator->translate("CONFIG_HOSTING_TYPE"), + "Type" => "dropdown", + "Options" => "vrt_hst,none,std_fwd,frm_fwd", + "Default" => "vrt_hst", + "Description" => $translator->translate("CONFIG_HOSTING_TYPE_DESCRIPTION"), + 'SimpleMode' => true, + ), ); diff --git a/templates/api/1.0.0.0/webspace_add.tpl b/templates/api/1.0.0.0/webspace_add.tpl index f767c1e..4a8ea53 100644 --- a/templates/api/1.0.0.0/webspace_add.tpl +++ b/templates/api/1.0.0.0/webspace_add.tpl @@ -8,6 +8,12 @@ + + + + + + @@ -18,6 +24,7 @@ true + diff --git a/templates/api/1.6.3.0/webspace_add.tpl b/templates/api/1.6.3.0/webspace_add.tpl index 310ef90..9a248c1 100644 --- a/templates/api/1.6.3.0/webspace_add.tpl +++ b/templates/api/1.6.3.0/webspace_add.tpl @@ -8,6 +8,12 @@ + + + + + + @@ -24,6 +30,7 @@ true + - + \ No newline at end of file diff --git a/templates/api/1.6.3.2/customer_del.tpl b/templates/api/1.6.3.2/customer_del.tpl new file mode 100644 index 0000000..07b7a23 --- /dev/null +++ b/templates/api/1.6.3.2/customer_del.tpl @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/templates/api/1.6.3.2/customer_get_by_external_id.tpl b/templates/api/1.6.3.2/customer_get_by_external_id.tpl new file mode 100644 index 0000000..07cdd7f --- /dev/null +++ b/templates/api/1.6.3.2/customer_get_by_external_id.tpl @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/templates/api/1.6.3.2/webspace_add.tpl b/templates/api/1.6.3.2/webspace_add.tpl index 4f40d83..5e6b235 100644 --- a/templates/api/1.6.3.2/webspace_add.tpl +++ b/templates/api/1.6.3.2/webspace_add.tpl @@ -6,7 +6,14 @@ + + + + + + + @@ -28,6 +35,7 @@ true + - + \ No newline at end of file diff --git a/templates/api/1.6.3.2/webspace_del.tpl b/templates/api/1.6.3.2/webspace_del.tpl new file mode 100644 index 0000000..b725d1b --- /dev/null +++ b/templates/api/1.6.3.2/webspace_del.tpl @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/templates/api/1.6.3.2/webspaces_get_by_owner_id.tpl b/templates/api/1.6.3.2/webspaces_get_by_owner_id.tpl new file mode 100644 index 0000000..7ed652a --- /dev/null +++ b/templates/api/1.6.3.2/webspaces_get_by_owner_id.tpl @@ -0,0 +1,11 @@ + + + + + + + + + + +