|
@@ -1,8 +1,8 @@
|
|
|
<?php
|
|
<?php
|
|
|
/**
|
|
/**
|
|
|
- * WHMCS cwp7 Provisioning Module
|
|
|
|
|
|
|
+ * WHMCS siteBuilder Provisioning Module
|
|
|
*
|
|
*
|
|
|
- * Provisioning for User Account on the cwp7 Server
|
|
|
|
|
|
|
+ * Provisioning for User Account on the siteBuilder Server
|
|
|
*
|
|
*
|
|
|
* @see https://centos-webpanel.com/
|
|
* @see https://centos-webpanel.com/
|
|
|
* @copyright Copyright (c) Thurdata GmbH 2022
|
|
* @copyright Copyright (c) Thurdata GmbH 2022
|
|
@@ -11,33 +11,33 @@
|
|
|
use WHMCS\Database\Capsule;
|
|
use WHMCS\Database\Capsule;
|
|
|
|
|
|
|
|
require_once 'Net/DNS2.php';
|
|
require_once 'Net/DNS2.php';
|
|
|
-require_once(__DIR__ . '/api/cwp7/Admin.php');
|
|
|
|
|
|
|
+require_once(__DIR__ . '/api/sitebuilder.php');
|
|
|
|
|
|
|
|
if (!defined('WHMCS')) {
|
|
if (!defined('WHMCS')) {
|
|
|
die('This file cannot be accessed directly');
|
|
die('This file cannot be accessed directly');
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * Define CWP7 product metadata parameters.
|
|
|
|
|
|
|
+ * Define siteBuilder product metadata parameters.
|
|
|
*
|
|
*
|
|
|
* @see https://developers.whmcs.com/provisioning-modules/meta-data-params/
|
|
* @see https://developers.whmcs.com/provisioning-modules/meta-data-params/
|
|
|
*
|
|
*
|
|
|
* @return array
|
|
* @return array
|
|
|
*/
|
|
*/
|
|
|
-function cwp7_MetaData() {
|
|
|
|
|
|
|
+function siteBuilder_MetaData() {
|
|
|
return array(
|
|
return array(
|
|
|
- 'DisplayName' => 'CentOS Web Panel Provisioning',
|
|
|
|
|
|
|
+ 'DisplayName' => 'ThurData SiteBuilder Provisioning',
|
|
|
'APIVersion' => '1.2',
|
|
'APIVersion' => '1.2',
|
|
|
- 'DefaultNonSSLPort' => '2031',
|
|
|
|
|
- 'DefaultSSLPort' => '2031',
|
|
|
|
|
|
|
+ 'DefaultNonSSLPort' => '80',
|
|
|
|
|
+ 'DefaultSSLPort' => '443',
|
|
|
'RequiresServer' => true,
|
|
'RequiresServer' => true,
|
|
|
- 'ServiceSingleSignOnLabel' => 'Login to CWP7',
|
|
|
|
|
- 'AdminSingleSignOnLabel' => 'Login to CWP7 Admin'
|
|
|
|
|
|
|
+ 'ServiceSingleSignOnLabel' => 'Login to siteBuilder',
|
|
|
|
|
+ 'AdminSingleSignOnLabel' => 'Login to siteBuilder Admin'
|
|
|
);
|
|
);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * Test connection to a CWP7 server with the given server parameters.
|
|
|
|
|
|
|
+ * Test connection to a siteBuilder server with the given server parameters.
|
|
|
*
|
|
*
|
|
|
* Allows an admin user to verify that an API connection can be
|
|
* Allows an admin user to verify that an API connection can be
|
|
|
* successfully made with the given configuration parameters for a
|
|
* successfully made with the given configuration parameters for a
|
|
@@ -53,9 +53,9 @@ function cwp7_MetaData() {
|
|
|
*
|
|
*
|
|
|
* @return array
|
|
* @return array
|
|
|
*/
|
|
*/
|
|
|
-function cwp7_Testconnection($params) {
|
|
|
|
|
- $cwp7 = new cwp7_Admin($params['serverhostname'], $params['serveraccesshash']);
|
|
|
|
|
- $response = $cwp7->getServerType();
|
|
|
|
|
|
|
+function siteBuilder_Testconnection($params) {
|
|
|
|
|
+ $siteBuilder = new siteBuilder_Admin($params['serverhostname'], $params['serveraccesshash']);
|
|
|
|
|
+ $response = $siteBuilder->getServerType();
|
|
|
if($response['status'] == 'OK') {
|
|
if($response['status'] == 'OK') {
|
|
|
return array(
|
|
return array(
|
|
|
'success' => true,
|
|
'success' => true,
|
|
@@ -63,7 +63,7 @@ function cwp7_Testconnection($params) {
|
|
|
);
|
|
);
|
|
|
}
|
|
}
|
|
|
logModuleCall(
|
|
logModuleCall(
|
|
|
- 'cwp7',
|
|
|
|
|
|
|
+ 'siteBuilder',
|
|
|
__FUNCTION__,
|
|
__FUNCTION__,
|
|
|
$params,
|
|
$params,
|
|
|
'debug',
|
|
'debug',
|
|
@@ -76,13 +76,13 @@ function cwp7_Testconnection($params) {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * Define CWP7 product configuration options.
|
|
|
|
|
|
|
+ * Define siteBuilder product configuration options.
|
|
|
*
|
|
*
|
|
|
* @see https://developers.whmcs.com/provisioning-modules/config-options/
|
|
* @see https://developers.whmcs.com/provisioning-modules/config-options/
|
|
|
*
|
|
*
|
|
|
* @return array
|
|
* @return array
|
|
|
*/
|
|
*/
|
|
|
-function cwp7_ConfigOptions() {
|
|
|
|
|
|
|
+function siteBuilder_ConfigOptions() {
|
|
|
$whmcs = App::self();
|
|
$whmcs = App::self();
|
|
|
$serverGroupID = $whmcs->get_req_var('servergroup');
|
|
$serverGroupID = $whmcs->get_req_var('servergroup');
|
|
|
$serverIDObj = Capsule::table('tblservergroupsrel')
|
|
$serverIDObj = Capsule::table('tblservergroupsrel')
|
|
@@ -98,28 +98,28 @@ function cwp7_ConfigOptions() {
|
|
|
->where('id', $serverIDs)
|
|
->where('id', $serverIDs)
|
|
|
->where('active', '=', 1)
|
|
->where('active', '=', 1)
|
|
|
->first();
|
|
->first();
|
|
|
- $cwp7 = new cwp7_Admin($server->hostname, $server->accesshash);
|
|
|
|
|
- $cwp7Packages = $cwp7->getPackages();
|
|
|
|
|
- if($cwp7Packages['status'] != 'OK') {
|
|
|
|
|
|
|
+ $siteBuilder = new siteBuilder_Admin($server->hostname, $server->accesshash);
|
|
|
|
|
+ $siteBuilderPackages = $siteBuilder->getPackages();
|
|
|
|
|
+ if($siteBuilderPackages['status'] != 'OK') {
|
|
|
logModuleCall(
|
|
logModuleCall(
|
|
|
- 'cwp7',
|
|
|
|
|
|
|
+ 'siteBuilder',
|
|
|
__FUNCTION__,
|
|
__FUNCTION__,
|
|
|
- $cwp7Packages['status'],
|
|
|
|
|
|
|
+ $siteBuilderPackages['status'],
|
|
|
'Could not fetch packages',
|
|
'Could not fetch packages',
|
|
|
- $cwp7Packages['error_msg']
|
|
|
|
|
|
|
+ $siteBuilderPackages['error_msg']
|
|
|
);
|
|
);
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
- $cwp7PackageNames = array();
|
|
|
|
|
- foreach($cwp7Packages['msj'] as $cwp7Package) {
|
|
|
|
|
- array_push($cwp7PackageNames, $cwp7Package['package_name']);
|
|
|
|
|
|
|
+ $siteBuilderPackageNames = array();
|
|
|
|
|
+ foreach($siteBuilderPackages['msj'] as $siteBuilderPackage) {
|
|
|
|
|
+ array_push($siteBuilderPackageNames, $siteBuilderPackage['package_name']);
|
|
|
}
|
|
}
|
|
|
$configOptions = array();
|
|
$configOptions = array();
|
|
|
$configOptions['package'] = array(
|
|
$configOptions['package'] = array(
|
|
|
- 'FriendlyName' => 'CWP7 Package',
|
|
|
|
|
|
|
+ 'FriendlyName' => 'siteBuilder Package',
|
|
|
'Type' => 'dropdown',
|
|
'Type' => 'dropdown',
|
|
|
- 'Options' => implode(',', $cwp7PackageNames),
|
|
|
|
|
- 'Description' => 'Select CWP7 Package',
|
|
|
|
|
|
|
+ 'Options' => implode(',', $siteBuilderPackageNames),
|
|
|
|
|
+ 'Description' => 'Select siteBuilder Package',
|
|
|
);
|
|
);
|
|
|
$configOptions['inode'] = array( "Type" => "text" , "Description" => "Max of inode", "Default" => "0",);
|
|
$configOptions['inode'] = array( "Type" => "text" , "Description" => "Max of inode", "Default" => "0",);
|
|
|
$configOptions['nofile'] = array( "Type" => "text", "Description" => "Max of nofile", "Default" => "100",);
|
|
$configOptions['nofile'] = array( "Type" => "text", "Description" => "Max of nofile", "Default" => "100",);
|
|
@@ -129,9 +129,9 @@ function cwp7_ConfigOptions() {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * Provision a new account of a CWP7 server.
|
|
|
|
|
|
|
+ * Provision a new account of a siteBuilder server.
|
|
|
*
|
|
*
|
|
|
- * Attempt to provision a new CWP7 account. This is
|
|
|
|
|
|
|
+ * Attempt to provision a new siteBuilder account. This is
|
|
|
* called any time provisioning is requested inside of WHMCS. Depending upon the
|
|
* called any time provisioning is requested inside of WHMCS. Depending upon the
|
|
|
* configuration, this can be any of:
|
|
* configuration, this can be any of:
|
|
|
* * When a new order is placed
|
|
* * When a new order is placed
|
|
@@ -144,7 +144,7 @@ function cwp7_ConfigOptions() {
|
|
|
*
|
|
*
|
|
|
* @return string 'success' or an error message
|
|
* @return string 'success' or an error message
|
|
|
*/
|
|
*/
|
|
|
-function cwp7_CreateAccount($params) {
|
|
|
|
|
|
|
+function siteBuilder_CreateAccount($params) {
|
|
|
$username = strtolower(substr($params['clientsdetails']['firstname'],0,2) . substr($params['clientsdetails']['lastname'],0,3)) . $params['serviceid'];
|
|
$username = strtolower(substr($params['clientsdetails']['firstname'],0,2) . substr($params['clientsdetails']['lastname'],0,3)) . $params['serviceid'];
|
|
|
$userdomain = $username . '.local';
|
|
$userdomain = $username . '.local';
|
|
|
try {
|
|
try {
|
|
@@ -158,7 +158,7 @@ function cwp7_CreateAccount($params) {
|
|
|
);
|
|
);
|
|
|
} catch (\Exception $e) {
|
|
} catch (\Exception $e) {
|
|
|
logModuleCall(
|
|
logModuleCall(
|
|
|
- 'cwp7',
|
|
|
|
|
|
|
+ 'siteBuilder',
|
|
|
__FUNCTION__,
|
|
__FUNCTION__,
|
|
|
$params,
|
|
$params,
|
|
|
'Error: could save username & domain in database',
|
|
'Error: could save username & domain in database',
|
|
@@ -178,8 +178,8 @@ function cwp7_CreateAccount($params) {
|
|
|
'nproc' => (int) $params["configoption4"],
|
|
'nproc' => (int) $params["configoption4"],
|
|
|
'server_ips'=>$params["serverip"],
|
|
'server_ips'=>$params["serverip"],
|
|
|
);
|
|
);
|
|
|
- $cwp7 = new cwp7_Admin($params['serverhostname'], $params['serveraccesshash']);
|
|
|
|
|
- $response = $cwp7->createAccount($data);
|
|
|
|
|
|
|
+ $siteBuilder = new siteBuilder_Admin($params['serverhostname'], $params['serveraccesshash']);
|
|
|
|
|
+ $response = $siteBuilder->createAccount($data);
|
|
|
}
|
|
}
|
|
|
if($response['status'] != 'OK') {
|
|
if($response['status'] != 'OK') {
|
|
|
return 'Error: ' . $response['error_msg'];
|
|
return 'Error: ' . $response['error_msg'];
|
|
@@ -188,7 +188,7 @@ function cwp7_CreateAccount($params) {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * Removes a CWP7 account.
|
|
|
|
|
|
|
+ * Removes a siteBuilder account.
|
|
|
*
|
|
*
|
|
|
* Called when a termination is requested. This can be invoked automatically for
|
|
* Called when a termination is requested. This can be invoked automatically for
|
|
|
* overdue products if enabled, or requested manually by an admin user.
|
|
* overdue products if enabled, or requested manually by an admin user.
|
|
@@ -199,9 +199,9 @@ function cwp7_CreateAccount($params) {
|
|
|
*
|
|
*
|
|
|
* @return string 'success' or an error message
|
|
* @return string 'success' or an error message
|
|
|
*/
|
|
*/
|
|
|
-function cwp7_TerminateAccount($params) {
|
|
|
|
|
- $cwp7 = new cwp7_Admin($params['serverhostname'], $params['serveraccesshash']);
|
|
|
|
|
- $response = $cwp7->deleteAccount(array('user' => $params['username'], 'email' => $params['clientsdetails']['email']));
|
|
|
|
|
|
|
+function siteBuilder_TerminateAccount($params) {
|
|
|
|
|
+ $siteBuilder = new siteBuilder_Admin($params['serverhostname'], $params['serveraccesshash']);
|
|
|
|
|
+ $response = $siteBuilder->deleteAccount(array('user' => $params['username'], 'email' => $params['clientsdetails']['email']));
|
|
|
if($response['status'] == 'Error') {
|
|
if($response['status'] == 'Error') {
|
|
|
return 'Error: ' . $response['msj'];
|
|
return 'Error: ' . $response['msj'];
|
|
|
}
|
|
}
|
|
@@ -209,7 +209,7 @@ function cwp7_TerminateAccount($params) {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * Set a CWP7 account to status inactive.
|
|
|
|
|
|
|
+ * Set a siteBuilder account to status inactive.
|
|
|
*
|
|
*
|
|
|
* Called when a suspension is requested. This is invoked automatically by WHMCS
|
|
* Called when a suspension is requested. This is invoked automatically by WHMCS
|
|
|
* when a product becomes overdue on payment or can be called manually by admin
|
|
* when a product becomes overdue on payment or can be called manually by admin
|
|
@@ -221,9 +221,9 @@ function cwp7_TerminateAccount($params) {
|
|
|
*
|
|
*
|
|
|
* @return string 'success' or an error message
|
|
* @return string 'success' or an error message
|
|
|
*/
|
|
*/
|
|
|
-function cwp7_SuspendAccount($params) {
|
|
|
|
|
- $cwp7 = new cwp7_Admin($params['serverhostname'], $params['serveraccesshash']);
|
|
|
|
|
- $response = $cwp7->suspendAccount($params['username']);
|
|
|
|
|
|
|
+function siteBuilder_SuspendAccount($params) {
|
|
|
|
|
+ $siteBuilder = new siteBuilder_Admin($params['serverhostname'], $params['serveraccesshash']);
|
|
|
|
|
+ $response = $siteBuilder->suspendAccount($params['username']);
|
|
|
if($response['status'] != 'OK') {
|
|
if($response['status'] != 'OK') {
|
|
|
return 'Error: ' . $response['error_msg'];
|
|
return 'Error: ' . $response['error_msg'];
|
|
|
}
|
|
}
|
|
@@ -231,7 +231,7 @@ function cwp7_SuspendAccount($params) {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * Set a CWP7 account to status active.
|
|
|
|
|
|
|
+ * Set a siteBuilder account to status active.
|
|
|
*
|
|
*
|
|
|
* Called when an un-suspension is requested. This is invoked
|
|
* Called when an un-suspension is requested. This is invoked
|
|
|
* automatically upon payment of an overdue invoice for a product, or
|
|
* automatically upon payment of an overdue invoice for a product, or
|
|
@@ -243,9 +243,9 @@ function cwp7_SuspendAccount($params) {
|
|
|
*
|
|
*
|
|
|
* @return string 'success' or an error message
|
|
* @return string 'success' or an error message
|
|
|
*/
|
|
*/
|
|
|
-function cwp7_UnsuspendAccount($params) {
|
|
|
|
|
- $cwp7 = new cwp7_Admin($params['serverhostname'], $params['serveraccesshash']);
|
|
|
|
|
- $response = $cwp7->unsuspendAccount($params['username']);
|
|
|
|
|
|
|
+function siteBuilder_UnsuspendAccount($params) {
|
|
|
|
|
+ $siteBuilder = new siteBuilder_Admin($params['serverhostname'], $params['serveraccesshash']);
|
|
|
|
|
+ $response = $siteBuilder->unsuspendAccount($params['username']);
|
|
|
if($response['status'] != 'OK') {
|
|
if($response['status'] != 'OK') {
|
|
|
return 'Error: ' . $response['error_msg'];
|
|
return 'Error: ' . $response['error_msg'];
|
|
|
}
|
|
}
|
|
@@ -265,10 +265,10 @@ function cwp7_UnsuspendAccount($params) {
|
|
|
*
|
|
*
|
|
|
* @return array
|
|
* @return array
|
|
|
*/
|
|
*/
|
|
|
-function cwp7_ClientArea($params) {
|
|
|
|
|
|
|
+function siteBuilder_ClientArea($params) {
|
|
|
$clientInfo = array('moduleclientarea' => '1');
|
|
$clientInfo = array('moduleclientarea' => '1');
|
|
|
- $cwp7 = new cwp7_Admin($params['serverhostname'], $params['serveraccesshash']);
|
|
|
|
|
- $response = $cwp7->getAutoSSL($params['username']);
|
|
|
|
|
|
|
+ $siteBuilder = new siteBuilder_Admin($params['serverhostname'], $params['serveraccesshash']);
|
|
|
|
|
+ $response = $siteBuilder->getAutoSSL($params['username']);
|
|
|
if($response['status'] == 'OK') {
|
|
if($response['status'] == 'OK') {
|
|
|
$sslSites = array();
|
|
$sslSites = array();
|
|
|
foreach($response['msj'] as $sslSite) {
|
|
foreach($response['msj'] as $sslSite) {
|
|
@@ -278,22 +278,22 @@ function cwp7_ClientArea($params) {
|
|
|
);
|
|
);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- $response = $cwp7->getAccount($params['username']);
|
|
|
|
|
|
|
+ $response = $siteBuilder->getAccount($params['username']);
|
|
|
if($response['status'] != 'OK') {
|
|
if($response['status'] != 'OK') {
|
|
|
logModuleCall(
|
|
logModuleCall(
|
|
|
- 'cwp7',
|
|
|
|
|
|
|
+ 'siteBuilder',
|
|
|
__FUNCTION__,
|
|
__FUNCTION__,
|
|
|
$params,
|
|
$params,
|
|
|
'debug',
|
|
'debug',
|
|
|
$response
|
|
$response
|
|
|
);
|
|
);
|
|
|
}
|
|
}
|
|
|
- if(cwp7CheckLimit($params,'domains')){
|
|
|
|
|
|
|
+ if(siteBuilderCheckLimit($params,'domains')){
|
|
|
$clientInfo['domainlimit'] = 1;
|
|
$clientInfo['domainlimit'] = 1;
|
|
|
} else {
|
|
} else {
|
|
|
$clientInfo['domainlimit'] = 0;
|
|
$clientInfo['domainlimit'] = 0;
|
|
|
};
|
|
};
|
|
|
- if(cwp7CheckLimit($params,'subdomins')){
|
|
|
|
|
|
|
+ if(siteBuilderCheckLimit($params,'subdomins')){
|
|
|
$clientInfo['subdomainlimit'] = 1;
|
|
$clientInfo['subdomainlimit'] = 1;
|
|
|
} else {
|
|
} else {
|
|
|
$clientInfo['subdomainlimit'] = 0;
|
|
$clientInfo['subdomainlimit'] = 0;
|
|
@@ -324,10 +324,10 @@ function cwp7_ClientArea($params) {
|
|
|
$domain['sslexpire'] = $sslSites[$domain['domain']]['expire'];
|
|
$domain['sslexpire'] = $sslSites[$domain['domain']]['expire'];
|
|
|
$domain['autossl'] = $sslSites[$domain['domain']]['auotssl'];
|
|
$domain['autossl'] = $sslSites[$domain['domain']]['auotssl'];
|
|
|
}
|
|
}
|
|
|
- if(cwp7CheckA($domain['domain'],$params['serverip'],$params['configoption5']) == 1) {
|
|
|
|
|
|
|
+ if(siteBuilderCheckA($domain['domain'],$params['serverip'],$params['configoption5']) == 1) {
|
|
|
$domain['DNS'] = 1;
|
|
$domain['DNS'] = 1;
|
|
|
}
|
|
}
|
|
|
- $domain['domainNS'] = cwp7CheckSOA($domain['domain'],$params['configoption5']);
|
|
|
|
|
|
|
+ $domain['domainNS'] = siteBuilderCheckSOA($domain['domain'],$params['configoption5']);
|
|
|
$domain['subdomains'] = array();
|
|
$domain['subdomains'] = array();
|
|
|
foreach($subDomains as $subDomain) {
|
|
foreach($subDomains as $subDomain) {
|
|
|
if($subDomain['domain'] == $domain['domain']) {
|
|
if($subDomain['domain'] == $domain['domain']) {
|
|
@@ -342,7 +342,7 @@ function cwp7_ClientArea($params) {
|
|
|
unset($subDomain['sslexpire']);
|
|
unset($subDomain['sslexpire']);
|
|
|
unset($subDomain['autossl']);
|
|
unset($subDomain['autossl']);
|
|
|
}
|
|
}
|
|
|
- if(cwp7CheckA($subFQDN,$params['serverip'],$params['configoption5']) == 1) {
|
|
|
|
|
|
|
+ if(siteBuilderCheckA($subFQDN,$params['serverip'],$params['configoption5']) == 1) {
|
|
|
$subDomain['DNS'] = 1;
|
|
$subDomain['DNS'] = 1;
|
|
|
} else {
|
|
} else {
|
|
|
unset($subDomain['DNS']);
|
|
unset($subDomain['DNS']);
|
|
@@ -360,7 +360,7 @@ function cwp7_ClientArea($params) {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * Perform single sign-on for a CWP7 account.
|
|
|
|
|
|
|
+ * Perform single sign-on for a siteBuilder account.
|
|
|
*
|
|
*
|
|
|
* When successful, returns a URL to which the user should be redirected.
|
|
* When successful, returns a URL to which the user should be redirected.
|
|
|
*
|
|
*
|
|
@@ -370,9 +370,9 @@ function cwp7_ClientArea($params) {
|
|
|
*
|
|
*
|
|
|
* @return array
|
|
* @return array
|
|
|
*/
|
|
*/
|
|
|
-function cwp7_ServiceSingleSignOn($params) {
|
|
|
|
|
- $cwp7 = new cwp7_Admin($params['serverhostname'], $params['serveraccesshash']);
|
|
|
|
|
- $response = $cwp7->getLoginLink($params['username']);
|
|
|
|
|
|
|
+function siteBuilder_ServiceSingleSignOn($params) {
|
|
|
|
|
+ $siteBuilder = new siteBuilder_Admin($params['serverhostname'], $params['serveraccesshash']);
|
|
|
|
|
+ $response = $siteBuilder->getLoginLink($params['username']);
|
|
|
if($response['status'] == 'OK') {
|
|
if($response['status'] == 'OK') {
|
|
|
$link = $response['msj']['details'];
|
|
$link = $response['msj']['details'];
|
|
|
$linkautologin = $link[0]['url'];
|
|
$linkautologin = $link[0]['url'];
|
|
@@ -389,7 +389,7 @@ function cwp7_ServiceSingleSignOn($params) {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * Change the password for a CWP7 account.
|
|
|
|
|
|
|
+ * Change the password for a siteBuilder account.
|
|
|
*
|
|
*
|
|
|
* Called when a password change is requested. This can occur either due to a
|
|
* Called when a password change is requested. This can occur either due to a
|
|
|
* client requesting it via the client area or an admin requesting it from the
|
|
* client requesting it via the client area or an admin requesting it from the
|
|
@@ -404,9 +404,9 @@ function cwp7_ServiceSingleSignOn($params) {
|
|
|
*
|
|
*
|
|
|
* @return string "success" or an error message
|
|
* @return string "success" or an error message
|
|
|
*/
|
|
*/
|
|
|
-function cwp7_ChangePassword($params) {
|
|
|
|
|
- $cwp7 = new cwp7_Admin($params['serverhostname'], $params['serveraccesshash']);
|
|
|
|
|
- $response = $cwp7->changePass(array('user' => $params['username'], 'password' => $params['password']));
|
|
|
|
|
|
|
+function siteBuilder_ChangePassword($params) {
|
|
|
|
|
+ $siteBuilder = new siteBuilder_Admin($params['serverhostname'], $params['serveraccesshash']);
|
|
|
|
|
+ $response = $siteBuilder->changePass(array('user' => $params['username'], 'password' => $params['password']));
|
|
|
if($response['status'] != 'OK') {
|
|
if($response['status'] != 'OK') {
|
|
|
return 'Error: ' . $response['error_msg'];
|
|
return 'Error: ' . $response['error_msg'];
|
|
|
}
|
|
}
|
|
@@ -414,7 +414,7 @@ function cwp7_ChangePassword($params) {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * Upgrade or downgrade a CWP7 account by package.
|
|
|
|
|
|
|
+ * Upgrade or downgrade a siteBuilder account by package.
|
|
|
*
|
|
*
|
|
|
* Called to apply any change in product assignment or parameters. It
|
|
* Called to apply any change in product assignment or parameters. It
|
|
|
* is called to provision upgrade or downgrade orders, as well as being
|
|
* is called to provision upgrade or downgrade orders, as well as being
|
|
@@ -429,8 +429,8 @@ function cwp7_ChangePassword($params) {
|
|
|
*
|
|
*
|
|
|
* @return string "success" or an error message
|
|
* @return string "success" or an error message
|
|
|
*/
|
|
*/
|
|
|
-function cwp7_ChangePackage($params) {
|
|
|
|
|
- $cwp7 = new cwp7_Admin($params['serverhostname'], $params['serveraccesshash']);
|
|
|
|
|
|
|
+function siteBuilder_ChangePackage($params) {
|
|
|
|
|
+ $siteBuilder = new siteBuilder_Admin($params['serverhostname'], $params['serveraccesshash']);
|
|
|
$data = array(
|
|
$data = array(
|
|
|
'user' => $params['username'],
|
|
'user' => $params['username'],
|
|
|
'email' => $params['clientsdetails']['email'],
|
|
'email' => $params['clientsdetails']['email'],
|
|
@@ -440,7 +440,7 @@ function cwp7_ChangePackage($params) {
|
|
|
'processes' => (int) $params["configoption4"],
|
|
'processes' => (int) $params["configoption4"],
|
|
|
'server_ips'=> $params["serverip"],
|
|
'server_ips'=> $params["serverip"],
|
|
|
);
|
|
);
|
|
|
- $response = $cwp7->modifyAccount($data);
|
|
|
|
|
|
|
+ $response = $siteBuilder->modifyAccount($data);
|
|
|
if($response['status'] != 'OK') {
|
|
if($response['status'] != 'OK') {
|
|
|
return 'Error: ' . $response['error_msg'];
|
|
return 'Error: ' . $response['error_msg'];
|
|
|
}
|
|
}
|
|
@@ -456,9 +456,9 @@ function cwp7_ChangePackage($params) {
|
|
|
*
|
|
*
|
|
|
* @see https://developers.whmcs.com/provisioning-modules/usage-update/
|
|
* @see https://developers.whmcs.com/provisioning-modules/usage-update/
|
|
|
*/
|
|
*/
|
|
|
-function cwp7_UsageUpdate($params) {
|
|
|
|
|
- $cwp7 = new cwp7_Admin($params['serverhostname'], $params['serveraccesshash']);
|
|
|
|
|
- $response = $cwp7->getAllAccounts();
|
|
|
|
|
|
|
+function siteBuilder_UsageUpdate($params) {
|
|
|
|
|
+ $siteBuilder = new siteBuilder_Admin($params['serverhostname'], $params['serveraccesshash']);
|
|
|
|
|
+ $response = $siteBuilder->getAllAccounts();
|
|
|
if($response['status'] == 'OK'){
|
|
if($response['status'] == 'OK'){
|
|
|
$results = $response['msj'];
|
|
$results = $response['msj'];
|
|
|
for($i = 0; $i < count($results); $i++){
|
|
for($i = 0; $i < count($results); $i++){
|
|
@@ -512,8 +512,8 @@ function cwp7_UsageUpdate($params) {
|
|
|
*
|
|
*
|
|
|
* @return array
|
|
* @return array
|
|
|
*/
|
|
*/
|
|
|
-function cwp7_ClientAreaCustomButtonArray ($params) {
|
|
|
|
|
- if(cwp7CheckLimit($params, 'domains')) {
|
|
|
|
|
|
|
+function siteBuilder_ClientAreaCustomButtonArray ($params) {
|
|
|
|
|
+ if(siteBuilderCheckLimit($params, 'domains')) {
|
|
|
return array();
|
|
return array();
|
|
|
}
|
|
}
|
|
|
return array(
|
|
return array(
|
|
@@ -531,7 +531,7 @@ function cwp7_ClientAreaCustomButtonArray ($params) {
|
|
|
*
|
|
*
|
|
|
* @return array
|
|
* @return array
|
|
|
*/
|
|
*/
|
|
|
-function cwp7_ClientAreaAllowedFunctions() {
|
|
|
|
|
|
|
+function siteBuilder_ClientAreaAllowedFunctions() {
|
|
|
return array(
|
|
return array(
|
|
|
"Enable SSL" => "enableSSL",
|
|
"Enable SSL" => "enableSSL",
|
|
|
"Renew SSL" => "renewSSL",
|
|
"Renew SSL" => "renewSSL",
|
|
@@ -563,17 +563,17 @@ function cwp7_ClientAreaAllowedFunctions() {
|
|
|
*
|
|
*
|
|
|
* @return array template information
|
|
* @return array template information
|
|
|
*/
|
|
*/
|
|
|
-function cwp7_newDomain($params) {
|
|
|
|
|
|
|
+function siteBuilder_newDomain($params) {
|
|
|
return array(
|
|
return array(
|
|
|
'breadcrumb' => 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=newDomain' => 'Neue Domain',
|
|
|
),
|
|
),
|
|
|
- 'templatefile' => 'cwp7_add_domain',
|
|
|
|
|
|
|
+ 'templatefile' => 'siteBuilder_add_domain',
|
|
|
);
|
|
);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * Adds a new domain to a CWP7 account.
|
|
|
|
|
|
|
+ * Adds a new domain to a siteBuilder account.
|
|
|
*
|
|
*
|
|
|
* @param array $params common module parameters
|
|
* @param array $params common module parameters
|
|
|
*
|
|
*
|
|
@@ -581,18 +581,18 @@ function cwp7_newDomain($params) {
|
|
|
*
|
|
*
|
|
|
* @return string "success" or an error message
|
|
* @return string "success" or an error message
|
|
|
*/
|
|
*/
|
|
|
-function cwp7_addDomain($params) {
|
|
|
|
|
|
|
+function siteBuilder_addDomain($params) {
|
|
|
if(!filter_var($_POST['d'], FILTER_VALIDATE_DOMAIN, FILTER_FLAG_HOSTNAME)){
|
|
if(!filter_var($_POST['d'], FILTER_VALIDATE_DOMAIN, FILTER_FLAG_HOSTNAME)){
|
|
|
return 'Error: invalid domain name';
|
|
return 'Error: invalid domain name';
|
|
|
}
|
|
}
|
|
|
- if(cwp7CheckLimit($params, 'domains')) {
|
|
|
|
|
|
|
+ if(siteBuilderCheckLimit($params, 'domains')) {
|
|
|
return 'Error: domain limit exceeded';
|
|
return 'Error: domain limit exceeded';
|
|
|
}
|
|
}
|
|
|
$vars['user'] = $params['username'];
|
|
$vars['user'] = $params['username'];
|
|
|
$vars['name'] = $_POST['d'];
|
|
$vars['name'] = $_POST['d'];
|
|
|
$vars['type'] = 'domain';
|
|
$vars['type'] = 'domain';
|
|
|
- $cwp7 = new cwp7_Admin($params['serverhostname'], $params['serveraccesshash']);
|
|
|
|
|
- $response = $cwp7->addDomain($vars);
|
|
|
|
|
|
|
+ $siteBuilder = new siteBuilder_Admin($params['serverhostname'], $params['serveraccesshash']);
|
|
|
|
|
+ $response = $siteBuilder->addDomain($vars);
|
|
|
if($response['status'] != 'OK') {
|
|
if($response['status'] != 'OK') {
|
|
|
return 'Error: ' . $response['error_msg'];
|
|
return 'Error: ' . $response['error_msg'];
|
|
|
}
|
|
}
|
|
@@ -608,7 +608,7 @@ function cwp7_addDomain($params) {
|
|
|
*
|
|
*
|
|
|
* @return array template information
|
|
* @return array template information
|
|
|
*/
|
|
*/
|
|
|
-function cwp7_newSubdomain($params) {
|
|
|
|
|
|
|
+function siteBuilder_newSubdomain($params) {
|
|
|
if(!filter_var($_POST['d'], FILTER_VALIDATE_DOMAIN, FILTER_FLAG_HOSTNAME)){
|
|
if(!filter_var($_POST['d'], FILTER_VALIDATE_DOMAIN, FILTER_FLAG_HOSTNAME)){
|
|
|
return 'Error: invalid domain name';
|
|
return 'Error: invalid domain name';
|
|
|
}
|
|
}
|
|
@@ -616,7 +616,7 @@ function cwp7_newSubdomain($params) {
|
|
|
'breadcrumb' => array(
|
|
'breadcrumb' => array(
|
|
|
'clientarea.php?action=productdetails&id=' . $params['serviceid'] . '&modop=custom&a=newSubdomain' => 'Neue Subdomain',
|
|
'clientarea.php?action=productdetails&id=' . $params['serviceid'] . '&modop=custom&a=newSubdomain' => 'Neue Subdomain',
|
|
|
),
|
|
),
|
|
|
- 'templatefile' => 'cwp7_add_subdomain',
|
|
|
|
|
|
|
+ 'templatefile' => 'siteBuilder_add_subdomain',
|
|
|
'vars' => array(
|
|
'vars' => array(
|
|
|
'domainselected' => $_POST['d'],
|
|
'domainselected' => $_POST['d'],
|
|
|
),
|
|
),
|
|
@@ -624,7 +624,7 @@ function cwp7_newSubdomain($params) {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * Adds a new subdomain to domain of a CWP7 account.
|
|
|
|
|
|
|
+ * Adds a new subdomain to domain of a siteBuilder account.
|
|
|
*
|
|
*
|
|
|
* @param array $params common module parameters
|
|
* @param array $params common module parameters
|
|
|
*
|
|
*
|
|
@@ -632,7 +632,7 @@ function cwp7_newSubdomain($params) {
|
|
|
*
|
|
*
|
|
|
* @return string "success" or an error message
|
|
* @return string "success" or an error message
|
|
|
*/
|
|
*/
|
|
|
-function cwp7_addSubdomain($params) {
|
|
|
|
|
|
|
+function siteBuilder_addSubdomain($params) {
|
|
|
if(!filter_var($_POST['d'], FILTER_VALIDATE_DOMAIN, FILTER_FLAG_HOSTNAME)){
|
|
if(!filter_var($_POST['d'], FILTER_VALIDATE_DOMAIN, FILTER_FLAG_HOSTNAME)){
|
|
|
return 'Error: invalid domain name';
|
|
return 'Error: invalid domain name';
|
|
|
}
|
|
}
|
|
@@ -642,14 +642,14 @@ function cwp7_addSubdomain($params) {
|
|
|
if($_POST['s'] == 'www') {
|
|
if($_POST['s'] == 'www') {
|
|
|
return 'Error: default Subdomain www wurde bereits automatisch erstellt' ;
|
|
return 'Error: default Subdomain www wurde bereits automatisch erstellt' ;
|
|
|
}
|
|
}
|
|
|
- if(cwp7CheckLimit($params, 'subdomins')) {
|
|
|
|
|
|
|
+ if(siteBuilderCheckLimit($params, 'subdomins')) {
|
|
|
return 'Error: subdomain limit exceeded';
|
|
return 'Error: subdomain limit exceeded';
|
|
|
}
|
|
}
|
|
|
$vars['user'] = $params['username'];
|
|
$vars['user'] = $params['username'];
|
|
|
$vars['name'] = $_POST['s'] . '.' . $_POST['d'];
|
|
$vars['name'] = $_POST['s'] . '.' . $_POST['d'];
|
|
|
$vars['type'] = 'subdomain';
|
|
$vars['type'] = 'subdomain';
|
|
|
- $cwp7 = new cwp7_Admin($params['serverhostname'], $params['serveraccesshash']);
|
|
|
|
|
- $response = $cwp7->addDomain($vars);
|
|
|
|
|
|
|
+ $siteBuilder = new siteBuilder_Admin($params['serverhostname'], $params['serveraccesshash']);
|
|
|
|
|
+ $response = $siteBuilder->addDomain($vars);
|
|
|
if($response['status'] != 'OK') {
|
|
if($response['status'] != 'OK') {
|
|
|
return 'Error: ' . $response['error_msg'];
|
|
return 'Error: ' . $response['error_msg'];
|
|
|
}
|
|
}
|
|
@@ -657,7 +657,7 @@ function cwp7_addSubdomain($params) {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * Opens a form to delete a domain from a CWP7 account.
|
|
|
|
|
|
|
+ * Opens a form to delete a domain from a siteBuilder account.
|
|
|
*
|
|
*
|
|
|
* @param array $params common module parameters
|
|
* @param array $params common module parameters
|
|
|
*
|
|
*
|
|
@@ -665,9 +665,9 @@ function cwp7_addSubdomain($params) {
|
|
|
*
|
|
*
|
|
|
* @return array template information
|
|
* @return array template information
|
|
|
*/
|
|
*/
|
|
|
-function cwp7_delDomainConfirm($params) {
|
|
|
|
|
|
|
+function siteBuilder_delDomainConfirm($params) {
|
|
|
return array(
|
|
return array(
|
|
|
- 'templatefile' => 'cwp7_del_domain_confirm',
|
|
|
|
|
|
|
+ 'templatefile' => 'siteBuilder_del_domain_confirm',
|
|
|
'vars' => array(
|
|
'vars' => array(
|
|
|
'deldomain' => $_POST['d'],
|
|
'deldomain' => $_POST['d'],
|
|
|
),
|
|
),
|
|
@@ -675,7 +675,7 @@ function cwp7_delDomainConfirm($params) {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * Removes a domain from a CWP7 account.
|
|
|
|
|
|
|
+ * Removes a domain from a siteBuilder account.
|
|
|
*
|
|
*
|
|
|
* @param array $params common module parameters
|
|
* @param array $params common module parameters
|
|
|
*
|
|
*
|
|
@@ -683,15 +683,15 @@ function cwp7_delDomainConfirm($params) {
|
|
|
*
|
|
*
|
|
|
* @return string "success" or an error message
|
|
* @return string "success" or an error message
|
|
|
*/
|
|
*/
|
|
|
-function cwp7_delDomain($params) {
|
|
|
|
|
|
|
+function siteBuilder_delDomain($params) {
|
|
|
if(!filter_var($_POST['d'], FILTER_VALIDATE_DOMAIN, FILTER_FLAG_HOSTNAME)){
|
|
if(!filter_var($_POST['d'], FILTER_VALIDATE_DOMAIN, FILTER_FLAG_HOSTNAME)){
|
|
|
return 'Error: invalid domain name';
|
|
return 'Error: invalid domain name';
|
|
|
}
|
|
}
|
|
|
- $cwp7 = new cwp7_Admin($params['serverhostname'], $params['serveraccesshash']);
|
|
|
|
|
- $response = $cwp7->getAccount($params['username']);
|
|
|
|
|
|
|
+ $siteBuilder = new siteBuilder_Admin($params['serverhostname'], $params['serveraccesshash']);
|
|
|
|
|
+ $response = $siteBuilder->getAccount($params['username']);
|
|
|
if($response['status'] != 'OK') {
|
|
if($response['status'] != 'OK') {
|
|
|
logModuleCall(
|
|
logModuleCall(
|
|
|
- 'cwp7',
|
|
|
|
|
|
|
+ 'siteBuilder',
|
|
|
__FUNCTION__,
|
|
__FUNCTION__,
|
|
|
$params,
|
|
$params,
|
|
|
'debug',
|
|
'debug',
|
|
@@ -707,7 +707,7 @@ function cwp7_delDomain($params) {
|
|
|
}
|
|
}
|
|
|
if(!in_array($_POST['d'], $clientdomains)) {
|
|
if(!in_array($_POST['d'], $clientdomains)) {
|
|
|
logModuleCall(
|
|
logModuleCall(
|
|
|
- 'cwp7',
|
|
|
|
|
|
|
+ 'siteBuilder',
|
|
|
__FUNCTION__,
|
|
__FUNCTION__,
|
|
|
$_POST,
|
|
$_POST,
|
|
|
'POST DATA VIOLATION',
|
|
'POST DATA VIOLATION',
|
|
@@ -719,7 +719,7 @@ function cwp7_delDomain($params) {
|
|
|
$vars['user'] = $params['username'];
|
|
$vars['user'] = $params['username'];
|
|
|
$vars['name'] = $_POST['d'];
|
|
$vars['name'] = $_POST['d'];
|
|
|
$vars['type'] = 'domain';
|
|
$vars['type'] = 'domain';
|
|
|
- $response = $cwp7->deleteDomain($vars);
|
|
|
|
|
|
|
+ $response = $siteBuilder->deleteDomain($vars);
|
|
|
if($response['status'] != 'OK') {
|
|
if($response['status'] != 'OK') {
|
|
|
return 'Error: ' . $response['error_msg'];
|
|
return 'Error: ' . $response['error_msg'];
|
|
|
}
|
|
}
|
|
@@ -727,7 +727,7 @@ function cwp7_delDomain($params) {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * Opens a form to delete a subdomain from domain of a CWP7 account.
|
|
|
|
|
|
|
+ * Opens a form to delete a subdomain from domain of a siteBuilder account.
|
|
|
*
|
|
*
|
|
|
* @param array $params common module parameters
|
|
* @param array $params common module parameters
|
|
|
*
|
|
*
|
|
@@ -735,9 +735,9 @@ function cwp7_delDomain($params) {
|
|
|
*
|
|
*
|
|
|
* @return array template information
|
|
* @return array template information
|
|
|
*/
|
|
*/
|
|
|
-function cwp7_delSubdomainConfirm($params) {
|
|
|
|
|
|
|
+function siteBuilder_delSubdomainConfirm($params) {
|
|
|
return array(
|
|
return array(
|
|
|
- 'templatefile' => 'cwp7_del_subdomain_confirm',
|
|
|
|
|
|
|
+ 'templatefile' => 'siteBuilder_del_subdomain_confirm',
|
|
|
'vars' => array(
|
|
'vars' => array(
|
|
|
'delsubdomain' => $_POST['d'],
|
|
'delsubdomain' => $_POST['d'],
|
|
|
),
|
|
),
|
|
@@ -745,7 +745,7 @@ function cwp7_delSubdomainConfirm($params) {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * Removes a subdomain from a domain of a CWP7 account.
|
|
|
|
|
|
|
+ * Removes a subdomain from a domain of a siteBuilder account.
|
|
|
*
|
|
*
|
|
|
* @param array $params common module parameters
|
|
* @param array $params common module parameters
|
|
|
*
|
|
*
|
|
@@ -753,15 +753,15 @@ function cwp7_delSubdomainConfirm($params) {
|
|
|
*
|
|
*
|
|
|
* @return string "success" or an error message
|
|
* @return string "success" or an error message
|
|
|
*/
|
|
*/
|
|
|
-function cwp7_delSubdomain($params) {
|
|
|
|
|
|
|
+function siteBuilder_delSubdomain($params) {
|
|
|
if(!filter_var($_POST['d'], FILTER_VALIDATE_DOMAIN, FILTER_FLAG_HOSTNAME)){
|
|
if(!filter_var($_POST['d'], FILTER_VALIDATE_DOMAIN, FILTER_FLAG_HOSTNAME)){
|
|
|
return 'Error: invalid domain name';
|
|
return 'Error: invalid domain name';
|
|
|
}
|
|
}
|
|
|
- $cwp7 = new cwp7_Admin($params['serverhostname'], $params['serveraccesshash']);
|
|
|
|
|
- $response = $cwp7->getAccount($params['username']);
|
|
|
|
|
|
|
+ $siteBuilder = new siteBuilder_Admin($params['serverhostname'], $params['serveraccesshash']);
|
|
|
|
|
+ $response = $siteBuilder->getAccount($params['username']);
|
|
|
if($response['status'] != 'OK') {
|
|
if($response['status'] != 'OK') {
|
|
|
logModuleCall(
|
|
logModuleCall(
|
|
|
- 'cwp7',
|
|
|
|
|
|
|
+ 'siteBuilder',
|
|
|
__FUNCTION__,
|
|
__FUNCTION__,
|
|
|
$params,
|
|
$params,
|
|
|
'debug',
|
|
'debug',
|
|
@@ -777,7 +777,7 @@ function cwp7_delSubdomain($params) {
|
|
|
}
|
|
}
|
|
|
if(!in_array($_POST['d'], $clientsubdomains)) {
|
|
if(!in_array($_POST['d'], $clientsubdomains)) {
|
|
|
logModuleCall(
|
|
logModuleCall(
|
|
|
- 'cwp7',
|
|
|
|
|
|
|
+ 'siteBuilder',
|
|
|
__FUNCTION__,
|
|
__FUNCTION__,
|
|
|
$_POST,
|
|
$_POST,
|
|
|
'POST DATA VIOLATION',
|
|
'POST DATA VIOLATION',
|
|
@@ -789,7 +789,7 @@ function cwp7_delSubdomain($params) {
|
|
|
$vars['user'] = $params['username'];
|
|
$vars['user'] = $params['username'];
|
|
|
$vars['name'] = $_POST['d'];
|
|
$vars['name'] = $_POST['d'];
|
|
|
$vars['type'] = 'subdomain';
|
|
$vars['type'] = 'subdomain';
|
|
|
- $response = $cwp7->deleteDomain($vars);
|
|
|
|
|
|
|
+ $response = $siteBuilder->deleteDomain($vars);
|
|
|
if($response['status'] != 'OK') {
|
|
if($response['status'] != 'OK') {
|
|
|
return 'Error: ' . $response['error_msg'];
|
|
return 'Error: ' . $response['error_msg'];
|
|
|
}
|
|
}
|
|
@@ -797,7 +797,7 @@ function cwp7_delSubdomain($params) {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * Opens a form to enable SSL for a subdomain or domain of a CWP7 account.
|
|
|
|
|
|
|
+ * Opens a form to enable SSL for a subdomain or domain of a siteBuilder account.
|
|
|
*
|
|
*
|
|
|
* @param array $params common module parameters
|
|
* @param array $params common module parameters
|
|
|
*
|
|
*
|
|
@@ -805,9 +805,9 @@ function cwp7_delSubdomain($params) {
|
|
|
*
|
|
*
|
|
|
* @return array template information
|
|
* @return array template information
|
|
|
*/
|
|
*/
|
|
|
-function cwp7_enableSSLConfirm($params) {
|
|
|
|
|
|
|
+function siteBuilder_enableSSLConfirm($params) {
|
|
|
return array(
|
|
return array(
|
|
|
- 'templatefile' => 'cwp7_enable_SSL_confirm',
|
|
|
|
|
|
|
+ 'templatefile' => 'siteBuilder_enable_SSL_confirm',
|
|
|
'vars' => array(
|
|
'vars' => array(
|
|
|
'SSLdomain' => $_POST['d'],
|
|
'SSLdomain' => $_POST['d'],
|
|
|
),
|
|
),
|
|
@@ -815,7 +815,7 @@ function cwp7_enableSSLConfirm($params) {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * Aktivate CWP7 AutoSSL for a subdomain or domain of a CWP7 account.
|
|
|
|
|
|
|
+ * Aktivate siteBuilder AutoSSL for a subdomain or domain of a siteBuilder account.
|
|
|
*
|
|
*
|
|
|
* @param array $params common module parameters
|
|
* @param array $params common module parameters
|
|
|
*
|
|
*
|
|
@@ -823,14 +823,14 @@ function cwp7_enableSSLConfirm($params) {
|
|
|
*
|
|
*
|
|
|
* @return string "success" or an error message
|
|
* @return string "success" or an error message
|
|
|
*/
|
|
*/
|
|
|
-function cwp7_enableSSL($params) {
|
|
|
|
|
|
|
+function siteBuilder_enableSSL($params) {
|
|
|
if(!filter_var($_POST['d'], FILTER_VALIDATE_DOMAIN, FILTER_FLAG_HOSTNAME)){
|
|
if(!filter_var($_POST['d'], FILTER_VALIDATE_DOMAIN, FILTER_FLAG_HOSTNAME)){
|
|
|
return 'Error: invalid domain name';
|
|
return 'Error: invalid domain name';
|
|
|
}
|
|
}
|
|
|
$vars['user'] = $params['username'];
|
|
$vars['user'] = $params['username'];
|
|
|
$vars['name'] = $_POST['d'];
|
|
$vars['name'] = $_POST['d'];
|
|
|
- $cwp7 = new cwp7_Admin($params['serverhostname'], $params['serveraccesshash']);
|
|
|
|
|
- $response = $cwp7->addAutoSSL($vars);
|
|
|
|
|
|
|
+ $siteBuilder = new siteBuilder_Admin($params['serverhostname'], $params['serveraccesshash']);
|
|
|
|
|
+ $response = $siteBuilder->addAutoSSL($vars);
|
|
|
if($response['status'] != 'OK') {
|
|
if($response['status'] != 'OK') {
|
|
|
return 'Error: ' . $response['error_msg'];
|
|
return 'Error: ' . $response['error_msg'];
|
|
|
}
|
|
}
|
|
@@ -838,7 +838,7 @@ function cwp7_enableSSL($params) {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * Opens a form to renew a SSL certificate for a subdomain or domain of a CWP7 account.
|
|
|
|
|
|
|
+ * Opens a form to renew a SSL certificate for a subdomain or domain of a siteBuilder account.
|
|
|
*
|
|
*
|
|
|
* @param array $params common module parameters
|
|
* @param array $params common module parameters
|
|
|
*
|
|
*
|
|
@@ -846,9 +846,9 @@ function cwp7_enableSSL($params) {
|
|
|
*
|
|
*
|
|
|
* @return array template information
|
|
* @return array template information
|
|
|
*/
|
|
*/
|
|
|
-function cwp7_renewSSLConfirm($params) {
|
|
|
|
|
|
|
+function siteBuilder_renewSSLConfirm($params) {
|
|
|
return array(
|
|
return array(
|
|
|
- 'templatefile' => 'cwp7_renew_SSL_confirm',
|
|
|
|
|
|
|
+ 'templatefile' => 'siteBuilder_renew_SSL_confirm',
|
|
|
'vars' => array(
|
|
'vars' => array(
|
|
|
'SSLdomain' => $_POST['d'],
|
|
'SSLdomain' => $_POST['d'],
|
|
|
),
|
|
),
|
|
@@ -856,7 +856,7 @@ function cwp7_renewSSLConfirm($params) {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * Renews a SSL certificate for a subdomain or domain of a CWP7 account.
|
|
|
|
|
|
|
+ * Renews a SSL certificate for a subdomain or domain of a siteBuilder account.
|
|
|
*
|
|
*
|
|
|
* @param array $params common module parameters
|
|
* @param array $params common module parameters
|
|
|
*
|
|
*
|
|
@@ -864,14 +864,14 @@ function cwp7_renewSSLConfirm($params) {
|
|
|
*
|
|
*
|
|
|
* @return string "success" or an error message
|
|
* @return string "success" or an error message
|
|
|
*/
|
|
*/
|
|
|
-function cwp7_renewSSL($params) {
|
|
|
|
|
|
|
+function siteBuilder_renewSSL($params) {
|
|
|
if(!filter_var($_POST['d'], FILTER_VALIDATE_DOMAIN, FILTER_FLAG_HOSTNAME)){
|
|
if(!filter_var($_POST['d'], FILTER_VALIDATE_DOMAIN, FILTER_FLAG_HOSTNAME)){
|
|
|
return 'Error: invalid domain name';
|
|
return 'Error: invalid domain name';
|
|
|
}
|
|
}
|
|
|
$vars['user'] = $params['username'];
|
|
$vars['user'] = $params['username'];
|
|
|
$vars['name'] = $_POST['d'];
|
|
$vars['name'] = $_POST['d'];
|
|
|
- $cwp7 = new cwp7_Admin($params['serverhostname'], $params['serveraccesshash']);
|
|
|
|
|
- $response = $cwp7->updateAutoSSL($vars);
|
|
|
|
|
|
|
+ $siteBuilder = new siteBuilder_Admin($params['serverhostname'], $params['serveraccesshash']);
|
|
|
|
|
+ $response = $siteBuilder->updateAutoSSL($vars);
|
|
|
if($response['status'] != 'OK') {
|
|
if($response['status'] != 'OK') {
|
|
|
return 'Error: ' . $response['error_msg'];
|
|
return 'Error: ' . $response['error_msg'];
|
|
|
}
|
|
}
|
|
@@ -879,7 +879,7 @@ function cwp7_renewSSL($params) {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * Opens a form to set a DNS record for a subdomain or domain of a CWP7 account.
|
|
|
|
|
|
|
+ * Opens a form to set a DNS record for a subdomain or domain of a siteBuilder account.
|
|
|
*
|
|
*
|
|
|
* @param array $params common module parameters
|
|
* @param array $params common module parameters
|
|
|
*
|
|
*
|
|
@@ -887,10 +887,10 @@ function cwp7_renewSSL($params) {
|
|
|
*
|
|
*
|
|
|
* @return array template information
|
|
* @return array template information
|
|
|
*/
|
|
*/
|
|
|
-function cwp7_setDNSConfirm($params) {
|
|
|
|
|
|
|
+function siteBuilder_setDNSConfirm($params) {
|
|
|
if(isset($_POST['s'])){
|
|
if(isset($_POST['s'])){
|
|
|
return array(
|
|
return array(
|
|
|
- 'templatefile' => 'cwp7_set_DNS_confirm',
|
|
|
|
|
|
|
+ 'templatefile' => 'siteBuilder_set_DNS_confirm',
|
|
|
'vars' => array(
|
|
'vars' => array(
|
|
|
'DNSdomain' => $_POST['d'],
|
|
'DNSdomain' => $_POST['d'],
|
|
|
'DNSsubdomain' => $_POST['s'],
|
|
'DNSsubdomain' => $_POST['s'],
|
|
@@ -898,7 +898,7 @@ function cwp7_setDNSConfirm($params) {
|
|
|
);
|
|
);
|
|
|
}
|
|
}
|
|
|
return array(
|
|
return array(
|
|
|
- 'templatefile' => 'cwp7_set_DNS_confirm',
|
|
|
|
|
|
|
+ 'templatefile' => 'siteBuilder_set_DNS_confirm',
|
|
|
'vars' => array(
|
|
'vars' => array(
|
|
|
'DNSdomain' => $_POST['d'],
|
|
'DNSdomain' => $_POST['d'],
|
|
|
),
|
|
),
|
|
@@ -906,7 +906,7 @@ function cwp7_setDNSConfirm($params) {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * Opens a form to unsset a DNS record for a subdomain or domain of a CWP7 account.
|
|
|
|
|
|
|
+ * Opens a form to unsset a DNS record for a subdomain or domain of a siteBuilder account.
|
|
|
*
|
|
*
|
|
|
* @param array $params common module parameters
|
|
* @param array $params common module parameters
|
|
|
*
|
|
*
|
|
@@ -914,10 +914,10 @@ function cwp7_setDNSConfirm($params) {
|
|
|
*
|
|
*
|
|
|
* @return array template information
|
|
* @return array template information
|
|
|
*/
|
|
*/
|
|
|
-function cwp7_unsetDNSConfirm($params) {
|
|
|
|
|
|
|
+function siteBuilder_unsetDNSConfirm($params) {
|
|
|
if(isset($_POST['s'])){
|
|
if(isset($_POST['s'])){
|
|
|
return array(
|
|
return array(
|
|
|
- 'templatefile' => 'cwp7_unset_DNS_confirm',
|
|
|
|
|
|
|
+ 'templatefile' => 'siteBuilder_unset_DNS_confirm',
|
|
|
'vars' => array(
|
|
'vars' => array(
|
|
|
'DNSdomain' => $_POST['d'],
|
|
'DNSdomain' => $_POST['d'],
|
|
|
'DNSsubdomain' => $_POST['s'],
|
|
'DNSsubdomain' => $_POST['s'],
|
|
@@ -925,7 +925,7 @@ function cwp7_unsetDNSConfirm($params) {
|
|
|
);
|
|
);
|
|
|
}
|
|
}
|
|
|
return array(
|
|
return array(
|
|
|
- 'templatefile' => 'cwp7_unset_DNS_confirm',
|
|
|
|
|
|
|
+ 'templatefile' => 'siteBuilder_unset_DNS_confirm',
|
|
|
'vars' => array(
|
|
'vars' => array(
|
|
|
'DNSdomain' => $_POST['d'],
|
|
'DNSdomain' => $_POST['d'],
|
|
|
),
|
|
),
|
|
@@ -933,7 +933,7 @@ function cwp7_unsetDNSConfirm($params) {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * Update a DNS zone for a domain setting a new record for a domain or subdomain of a CWP7 account.
|
|
|
|
|
|
|
+ * Update a DNS zone for a domain setting a new record for a domain or subdomain of a siteBuilder account.
|
|
|
*
|
|
*
|
|
|
* @param array $params common module parameters
|
|
* @param array $params common module parameters
|
|
|
*
|
|
*
|
|
@@ -941,7 +941,7 @@ function cwp7_unsetDNSConfirm($params) {
|
|
|
*
|
|
*
|
|
|
* @return string "success" or an error message
|
|
* @return string "success" or an error message
|
|
|
*/
|
|
*/
|
|
|
-function cwp7_setDNS($params) {
|
|
|
|
|
|
|
+function siteBuilder_setDNS($params) {
|
|
|
if(!filter_var($_POST['d'], FILTER_VALIDATE_DOMAIN, FILTER_FLAG_HOSTNAME)){
|
|
if(!filter_var($_POST['d'], FILTER_VALIDATE_DOMAIN, FILTER_FLAG_HOSTNAME)){
|
|
|
return 'Error: invalid domain name';
|
|
return 'Error: invalid domain name';
|
|
|
}
|
|
}
|
|
@@ -1015,7 +1015,7 @@ function cwp7_setDNS($params) {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * Removing a DNS record for a domain or subdomain of a CWP7 account.
|
|
|
|
|
|
|
+ * Removing a DNS record for a domain or subdomain of a siteBuilder account.
|
|
|
*
|
|
*
|
|
|
* @param array $params common module parameters
|
|
* @param array $params common module parameters
|
|
|
*
|
|
*
|
|
@@ -1023,7 +1023,7 @@ function cwp7_setDNS($params) {
|
|
|
*
|
|
*
|
|
|
* @return string "success" or an error message
|
|
* @return string "success" or an error message
|
|
|
*/
|
|
*/
|
|
|
-function cwp7_unsetDNS($params) {
|
|
|
|
|
|
|
+function siteBuilder_unsetDNS($params) {
|
|
|
if(!filter_var($_POST['d'], FILTER_VALIDATE_DOMAIN, FILTER_FLAG_HOSTNAME)){
|
|
if(!filter_var($_POST['d'], FILTER_VALIDATE_DOMAIN, FILTER_FLAG_HOSTNAME)){
|
|
|
return 'Error: invalid domain name';
|
|
return 'Error: invalid domain name';
|
|
|
}
|
|
}
|
|
@@ -1067,7 +1067,7 @@ function cwp7_unsetDNS($params) {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * Opens a form to inform about the DNS status of a subdomain or domain of a CWP7 account.
|
|
|
|
|
|
|
+ * Opens a form to inform about the DNS status of a subdomain or domain of a siteBuilder account.
|
|
|
*
|
|
*
|
|
|
* @param array $params common module parameters
|
|
* @param array $params common module parameters
|
|
|
*
|
|
*
|
|
@@ -1075,22 +1075,22 @@ function cwp7_unsetDNS($params) {
|
|
|
*
|
|
*
|
|
|
* @return array template information
|
|
* @return array template information
|
|
|
*/
|
|
*/
|
|
|
-function cwp7_infoDNS($params) {
|
|
|
|
|
|
|
+function siteBuilder_infoDNS($params) {
|
|
|
if(!filter_var($_POST['d'], FILTER_VALIDATE_DOMAIN, FILTER_FLAG_HOSTNAME)){
|
|
if(!filter_var($_POST['d'], FILTER_VALIDATE_DOMAIN, FILTER_FLAG_HOSTNAME)){
|
|
|
return 'Error: invalid domain name';
|
|
return 'Error: invalid domain name';
|
|
|
}
|
|
}
|
|
|
- $cwp7nameserver = cwp7CheckSOA($_POST['d'],$params['configoption5']);
|
|
|
|
|
|
|
+ $siteBuildernameserver = siteBuilderCheckSOA($_POST['d'],$params['configoption5']);
|
|
|
return array(
|
|
return array(
|
|
|
- 'templatefile' => 'cwp7_help_dns',
|
|
|
|
|
|
|
+ 'templatefile' => 'siteBuilder_help_dns',
|
|
|
'vars' => array(
|
|
'vars' => array(
|
|
|
'infodomain' => $_POST['d'],
|
|
'infodomain' => $_POST['d'],
|
|
|
- 'cwp7nameserver' => $cwp7nameserver,
|
|
|
|
|
|
|
+ 'siteBuildernameserver' => $siteBuildernameserver,
|
|
|
),
|
|
),
|
|
|
);
|
|
);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * Opens a form to inform about the SSL status of a subdomain or domain of a CWP7 account.
|
|
|
|
|
|
|
+ * Opens a form to inform about the SSL status of a subdomain or domain of a siteBuilder account.
|
|
|
*
|
|
*
|
|
|
* @param array $params common module parameters
|
|
* @param array $params common module parameters
|
|
|
*
|
|
*
|
|
@@ -1098,12 +1098,12 @@ function cwp7_infoDNS($params) {
|
|
|
*
|
|
*
|
|
|
* @return array template information
|
|
* @return array template information
|
|
|
*/
|
|
*/
|
|
|
-function cwp7_infoSSL($params) {
|
|
|
|
|
|
|
+function siteBuilder_infoSSL($params) {
|
|
|
if(!filter_var($_POST['d'], FILTER_VALIDATE_DOMAIN, FILTER_FLAG_HOSTNAME)){
|
|
if(!filter_var($_POST['d'], FILTER_VALIDATE_DOMAIN, FILTER_FLAG_HOSTNAME)){
|
|
|
return 'Error: invalid domain name';
|
|
return 'Error: invalid domain name';
|
|
|
}
|
|
}
|
|
|
return array(
|
|
return array(
|
|
|
- 'templatefile' => 'cwp7_help_ssl',
|
|
|
|
|
|
|
+ 'templatefile' => 'siteBuilder_help_ssl',
|
|
|
'vars' => array(
|
|
'vars' => array(
|
|
|
'infodomain' => $_POST['d'],
|
|
'infodomain' => $_POST['d'],
|
|
|
),
|
|
),
|
|
@@ -1114,7 +1114,7 @@ function cwp7_infoSSL($params) {
|
|
|
* Ask nameservers for a IP adress of a given host.
|
|
* Ask nameservers for a IP adress of a given host.
|
|
|
*
|
|
*
|
|
|
* @param string $host hostname
|
|
* @param string $host hostname
|
|
|
- * @param string $serverIP CWP7 server IP
|
|
|
|
|
|
|
+ * @param string $serverIP siteBuilder server IP
|
|
|
* @param string $nameserverIP polled name server IP
|
|
* @param string $nameserverIP polled name server IP
|
|
|
* @param int $recurse optional -> used to follow CNAME responses
|
|
* @param int $recurse optional -> used to follow CNAME responses
|
|
|
*
|
|
*
|
|
@@ -1122,7 +1122,7 @@ function cwp7_infoSSL($params) {
|
|
|
*
|
|
*
|
|
|
* @return bool
|
|
* @return bool
|
|
|
*/
|
|
*/
|
|
|
-function cwp7CheckA($host, $serverIP, $nameserverIP, $recurse = 0) {
|
|
|
|
|
|
|
+function siteBuilderCheckA($host, $serverIP, $nameserverIP, $recurse = 0) {
|
|
|
if($recurse > 3) {
|
|
if($recurse > 3) {
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
@@ -1138,7 +1138,7 @@ function cwp7CheckA($host, $serverIP, $nameserverIP, $recurse = 0) {
|
|
|
$result = $resolver->query($host, 'A');
|
|
$result = $resolver->query($host, 'A');
|
|
|
} catch(Net_DNS2_Exception $e) {
|
|
} catch(Net_DNS2_Exception $e) {
|
|
|
logModuleCall(
|
|
logModuleCall(
|
|
|
- 'cwp7',
|
|
|
|
|
|
|
+ 'siteBuilder',
|
|
|
__FUNCTION__,
|
|
__FUNCTION__,
|
|
|
$e,
|
|
$e,
|
|
|
'DNS lookup exception',
|
|
'DNS lookup exception',
|
|
@@ -1149,7 +1149,7 @@ function cwp7CheckA($host, $serverIP, $nameserverIP, $recurse = 0) {
|
|
|
}
|
|
}
|
|
|
$hostA = $result->answer;
|
|
$hostA = $result->answer;
|
|
|
if($hostA[0]->type == 'CNAME') {
|
|
if($hostA[0]->type == 'CNAME') {
|
|
|
- if(cwp7CheckA($hostA[0]->cname, $serverIP, $nameserverIP, $recurse++)) {
|
|
|
|
|
|
|
+ if(siteBuilderCheckA($hostA[0]->cname, $serverIP, $nameserverIP, $recurse++)) {
|
|
|
return true;
|
|
return true;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -1172,7 +1172,7 @@ function cwp7CheckA($host, $serverIP, $nameserverIP, $recurse = 0) {
|
|
|
*
|
|
*
|
|
|
* @return string 'none' -> not registered, 'self' -> registered at own or the name of an other responsible nameserver
|
|
* @return string 'none' -> not registered, 'self' -> registered at own or the name of an other responsible nameserver
|
|
|
*/
|
|
*/
|
|
|
-function cwp7CheckSOA($domain, $nameserverIP) {
|
|
|
|
|
|
|
+function siteBuilderCheckSOA($domain, $nameserverIP) {
|
|
|
$nameserver = array($nameserverIP);
|
|
$nameserver = array($nameserverIP);
|
|
|
# try NS1
|
|
# try NS1
|
|
|
$resolver = new Net_DNS2_Resolver(array('nameservers' => $nameserver));
|
|
$resolver = new Net_DNS2_Resolver(array('nameservers' => $nameserver));
|
|
@@ -1201,9 +1201,9 @@ function cwp7CheckSOA($domain, $nameserverIP) {
|
|
|
*
|
|
*
|
|
|
* @return bool true -> limit reached, false -> limit not reached
|
|
* @return bool true -> limit reached, false -> limit not reached
|
|
|
*/
|
|
*/
|
|
|
-function cwp7CheckLimit($params, $type) {
|
|
|
|
|
- $cwp7 = new cwp7_Admin($params['serverhostname'], $params['serveraccesshash']);
|
|
|
|
|
- $response = $cwp7->getQuota($params['username']);
|
|
|
|
|
|
|
+function siteBuilderCheckLimit($params, $type) {
|
|
|
|
|
+ $siteBuilder = new siteBuilder_Admin($params['serverhostname'], $params['serveraccesshash']);
|
|
|
|
|
+ $response = $siteBuilder->getQuota($params['username']);
|
|
|
if($response[$type]['sw'] < 1) {
|
|
if($response[$type]['sw'] < 1) {
|
|
|
return true;
|
|
return true;
|
|
|
}
|
|
}
|