|
|
@@ -621,8 +621,7 @@ function siteBuilder_editSite($params) {
|
|
|
$e->getMessage()
|
|
|
);
|
|
|
return 'Error: Request error';
|
|
|
-}
|
|
|
-
|
|
|
+ }
|
|
|
return 'success';
|
|
|
}
|
|
|
|
|
|
@@ -728,6 +727,29 @@ function siteBuilder_revSite($params) {
|
|
|
return 'success';
|
|
|
}
|
|
|
|
|
|
+/**
|
|
|
+ * Removes a domain from 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_pubSite($params) {
|
|
|
+ if(!filter_var($_POST['p'], FILTER_VALIDATE_DOMAIN, FILTER_FLAG_HOSTNAME)){
|
|
|
+ return 'Error: invalid domain name';
|
|
|
+ }
|
|
|
+ $site = $_POST['p'];
|
|
|
+ $siteBuilder = new ApiClient(getSiteBuilderApiURL($params), $params['serveraccesshash']);
|
|
|
+ // migrate dev to prod
|
|
|
+ $response = $siteBuilder->migrate($params['username'], 'dev.' . $site, $params['serverusername'], $params['serverpassword']);
|
|
|
+ if($response['status'] != '200') {
|
|
|
+ return 'Error: ' . $response['response'];
|
|
|
+ }
|
|
|
+ return 'success';
|
|
|
+}
|
|
|
+
|
|
|
/**
|
|
|
* Returns API Url .
|
|
|
*
|