|
|
@@ -379,7 +379,7 @@ function siteBuilder_UsageUpdate($params) {
|
|
|
*/
|
|
|
function siteBuilder_ClientAreaCustomButtonArray ($params) {
|
|
|
return array(
|
|
|
- 'Neue Domain' => 'newDomain',
|
|
|
+ 'Neue Webseite' => 'newSite',
|
|
|
);
|
|
|
}
|
|
|
|
|
|
@@ -395,14 +395,10 @@ function siteBuilder_ClientAreaCustomButtonArray ($params) {
|
|
|
*/
|
|
|
function siteBuilder_ClientAreaAllowedFunctions() {
|
|
|
return array(
|
|
|
- "Add Domain" => "addDomain",
|
|
|
- "new Domain" => "newDomain",
|
|
|
- "Add Subdomain" => "addSubdomain",
|
|
|
- "New Subdomain" => "newSubdomain",
|
|
|
- "Confirm Delete Domain" => "delDomainConfirm",
|
|
|
- "Delete Domain" => "delDomain",
|
|
|
- "Confirm Delete Subdomain" => "delSubdomainConfirm",
|
|
|
- "Delete Subdomain" => "delSubdomain",
|
|
|
+ "Add Site" => "addSite",
|
|
|
+ "new Site" => "newSite",
|
|
|
+ "Confirm Delete Site" => "delSiteConfirm",
|
|
|
+ "Delete Site" => "delSite",
|
|
|
);
|
|
|
}
|
|
|
|
|
|
@@ -415,12 +411,12 @@ function siteBuilder_ClientAreaAllowedFunctions() {
|
|
|
*
|
|
|
* @return array template information
|
|
|
*/
|
|
|
-function siteBuilder_newDomain($params) {
|
|
|
+function siteBuilder_newSite($params) {
|
|
|
return array(
|
|
|
'breadcrumb' => array(
|
|
|
- 'clientarea.php?action=productdetails&id=' . $params['serviceid'] . '&modop=custom&a=newDomain' => 'Neue Domain',
|
|
|
+ 'clientarea.php?action=productdetails&id=' . $params['serviceid'] . '&modop=custom&a=newSite' => 'Neue Webseite',
|
|
|
),
|
|
|
- 'templatefile' => 'siteBuilder_add_domain',
|
|
|
+ 'templatefile' => 'siteBuilder_new_site',
|
|
|
);
|
|
|
}
|
|
|
|
|
|
@@ -433,55 +429,15 @@ function siteBuilder_newDomain($params) {
|
|
|
*
|
|
|
* @return string "success" or an error message
|
|
|
*/
|
|
|
-function siteBuilder_addDomain($params) {
|
|
|
+function siteBuilder_addSite($params) {
|
|
|
if(!filter_var($_POST['d'], FILTER_VALIDATE_DOMAIN, FILTER_FLAG_HOSTNAME)){
|
|
|
- return 'Error: invalid domain name';
|
|
|
- }
|
|
|
- return 'success';
|
|
|
-}
|
|
|
-
|
|
|
-/**
|
|
|
- * Opens a form to add a new subdomain to a domain.
|
|
|
- *
|
|
|
- * @param array $params common module parameters
|
|
|
- *
|
|
|
- * @see https://developers.whmcs.com/provisioning-modules/supported-functions/
|
|
|
- *
|
|
|
- * @return array template information
|
|
|
- */
|
|
|
-function siteBuilder_newSubdomain($params) {
|
|
|
- if(!filter_var($_POST['d'], FILTER_VALIDATE_DOMAIN, FILTER_FLAG_HOSTNAME)){
|
|
|
- return 'Error: invalid domain name';
|
|
|
- }
|
|
|
- return array(
|
|
|
- 'breadcrumb' => array(
|
|
|
- 'clientarea.php?action=productdetails&id=' . $params['serviceid'] . '&modop=custom&a=newSubdomain' => 'Neue Subdomain',
|
|
|
- ),
|
|
|
- 'templatefile' => 'siteBuilder_add_subdomain',
|
|
|
- 'vars' => array(
|
|
|
- 'domainselected' => $_POST['d'],
|
|
|
- ),
|
|
|
- );
|
|
|
-}
|
|
|
-
|
|
|
-/**
|
|
|
- * Adds a new subdomain to domain of a siteBuilder account.
|
|
|
- *
|
|
|
- * @param array $params common module parameters
|
|
|
- *
|
|
|
- * @see https://developers.whmcs.com/provisioning-modules/supported-functions/
|
|
|
- *
|
|
|
- * @return string "success" or an error message
|
|
|
- */
|
|
|
-function siteBuilder_addSubdomain($params) {
|
|
|
- if(!filter_var($_POST['d'], FILTER_VALIDATE_DOMAIN, FILTER_FLAG_HOSTNAME)){
|
|
|
- return 'Error: invalid domain name';
|
|
|
- }
|
|
|
- if(!filter_var($_POST['s'], FILTER_VALIDATE_DOMAIN, FILTER_FLAG_HOSTNAME)){
|
|
|
- return 'Error: invalid subdomain name';
|
|
|
+ return 'Error: invalid site name';
|
|
|
}
|
|
|
- if($_POST['s'] == 'www') {
|
|
|
- return 'Error: default Subdomain www wurde bereits automatisch erstellt' ;
|
|
|
+ $site = $_POST['d'] . '.' . $params['domain'];
|
|
|
+ $siteBuilder = new ApiClient(getSiteBuilderApiURL($params), $params['serveraccesshash']);
|
|
|
+ $response = $siteBuilder->deployDev($params['username'], $site, $params['serverusername'], $params['serverpassword']);
|
|
|
+ if($response['status'] != '200') {
|
|
|
+ return 'Error: ' . $response['response'];
|
|
|
}
|
|
|
return 'success';
|
|
|
}
|
|
|
@@ -520,40 +476,6 @@ function siteBuilder_delDomain($params) {
|
|
|
return 'success';
|
|
|
}
|
|
|
|
|
|
-/**
|
|
|
- * Opens a form to delete a subdomain from domain of a siteBuilder account.
|
|
|
- *
|
|
|
- * @param array $params common module parameters
|
|
|
- *
|
|
|
- * @see https://developers.whmcs.com/provisioning-modules/supported-functions/
|
|
|
- *
|
|
|
- * @return array template information
|
|
|
- */
|
|
|
-function siteBuilder_delSubdomainConfirm($params) {
|
|
|
- return array(
|
|
|
- 'templatefile' => 'siteBuilder_del_subdomain_confirm',
|
|
|
- 'vars' => array(
|
|
|
- 'delsubdomain' => $_POST['d'],
|
|
|
- ),
|
|
|
- );
|
|
|
-}
|
|
|
-
|
|
|
-/**
|
|
|
- * Removes a subdomain from a domain of a siteBuilder account.
|
|
|
- *
|
|
|
- * @param array $params common module parameters
|
|
|
- *
|
|
|
- * @see https://developers.whmcs.com/provisioning-modules/supported-functions/
|
|
|
- *
|
|
|
- * @return string "success" or an error message
|
|
|
- */
|
|
|
-function siteBuilder_delSubdomain($params) {
|
|
|
- if(!filter_var($_POST['d'], FILTER_VALIDATE_DOMAIN, FILTER_FLAG_HOSTNAME)){
|
|
|
- return 'Error: invalid domain name';
|
|
|
- }
|
|
|
- return 'success';
|
|
|
-}
|
|
|
-
|
|
|
/**
|
|
|
* Returns API Url .
|
|
|
*
|