Skip to content
This repository was archived by the owner on Feb 25, 2020. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.autogit
12 changes: 12 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -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'.
2 changes: 2 additions & 0 deletions lang/english.php
Original file line number Diff line number Diff line change
Expand Up @@ -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@",
Expand Down
2 changes: 1 addition & 1 deletion lib/Plesk/Manager/V1000.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
Expand Down
15 changes: 1 addition & 14 deletions lib/Plesk/Manager/V1630.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 5 additions & 0 deletions lib/Plesk/Manager/V1632.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 0 additions & 2 deletions lib/Plesk/Object/Webspace.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,4 @@
class Plesk_Object_Webspace
{
const STATUS_ACTIVE = 0;

const TYPE_VRT_HST = 'vrt_hst';
}
8 changes: 8 additions & 0 deletions plesk.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
),

);

Expand Down
7 changes: 7 additions & 0 deletions templates/api/1.0.0.0/webspace_add.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@
<htype><?php echo $htype; ?></htype>
<status><?php echo $status; ?></status>
</gen_setup>
<?php if ($htype === 'none'): ?>
<hosting>
<none></none>
</hosting>
<?php endif; ?>
<?php if ($htype === 'vrt_hst'): ?>
<hosting>
<vrt_hst>
<ftp_login><?php echo $username; ?></ftp_login>
Expand All @@ -18,6 +24,7 @@
<prefs>
<www>true</www>
</prefs>
<?php endif; ?>
<template-name><?php echo $planName; ?></template-name>
</add>
</domain>
9 changes: 8 additions & 1 deletion templates/api/1.6.3.0/webspace_add.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@
<htype><?php echo $htype; ?></htype>
<status><?php echo $status; ?></status>
</gen_setup>
<?php if ($htype === 'none'): ?>
<hosting>
<none></none>
</hosting>
<?php endif; ?>
<?php if ($htype === 'vrt_hst'): ?>
<hosting>
<vrt_hst>
<property>
Expand All @@ -24,6 +30,7 @@
<prefs>
<www>true</www>
</prefs>
<?php endif; ?>
<plan-name><?php echo $planName; ?></plan-name>
</add>
</webspace>
</webspace>
8 changes: 8 additions & 0 deletions templates/api/1.6.3.2/customer_del.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<!-- Copyright 1999-2016. Parallels IP Holdings GmbH. -->
<customer>
<del>
<filter>
<id><?php echo $id; ?></id>
</filter>
</del>
</customer>
11 changes: 11 additions & 0 deletions templates/api/1.6.3.2/customer_get_by_external_id.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- Copyright 1999-2016. Parallels IP Holdings GmbH. -->
<customer>
<get>
<filter>
<external-id><?php echo $externalId; ?></external-id>
</filter>
<dataset>
<gen_info/>
</dataset>
</get>
</customer>
10 changes: 9 additions & 1 deletion templates/api/1.6.3.2/webspace_add.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,14 @@
<owner-id><?php echo $ownerId; ?></owner-id>
<htype><?php echo $htype; ?></htype>
<status><?php echo $status; ?></status>
<ip_address><?php echo $ipv4Address; ?></ip_address>
</gen_setup>
<?php if ($htype === 'none'): ?>
<hosting>
<none></none>
</hosting>
<?php endif; ?>
<?php if ($htype === 'vrt_hst'): ?>
<hosting>
<vrt_hst>
<property>
Expand All @@ -28,6 +35,7 @@
<prefs>
<www>true</www>
</prefs>
<?php endif; ?>
<plan-name><?php echo $planName; ?></plan-name>
</add>
</webspace>
</webspace>
8 changes: 8 additions & 0 deletions templates/api/1.6.3.2/webspace_del.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<!-- Copyright 1999-2016. Parallels IP Holdings GmbH. -->
<webspace>
<del>
<filter>
<name><?php echo $domain; ?></name>
</filter>
</del>
</webspace>
11 changes: 11 additions & 0 deletions templates/api/1.6.3.2/webspaces_get_by_owner_id.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- Copyright 1999-2016. Parallels IP Holdings GmbH. -->
<webspace>
<get>
<filter>
<owner-id><?php echo $ownerId; ?></owner-id>
</filter>
<dataset>
<hosting/>
</dataset>
</get>
</webspace>