|
|
@@ -73,7 +73,20 @@ class CreateAccount extends AddonController
|
|
|
{
|
|
|
$productManager = new ProductManager();
|
|
|
$productManager->loadById($params['pid']);
|
|
|
-
|
|
|
+ $acc_limit = $productManager->get('acc_limit');
|
|
|
+ $accounts = $productManager->get('acc_base') + $params['configoptions']['acc_add'] + $params['configoptions']['acc_new'];
|
|
|
+ if ($acc_limit >= 0) {
|
|
|
+ if ($accounts > $acc_limit) {
|
|
|
+ $accounts = $acc_limit;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ $domainMaxSize = $productManager->get('domainMaxSize');
|
|
|
+ $domainSize = $productManager->get('domainBaseSize') + $params['configoptions']['domainAddSize'] + $params['configoptions']['domainNewSize'];
|
|
|
+ if ($domainMaxSize >= 0) {
|
|
|
+ if ($domainSize > $domainMaxSize) {
|
|
|
+ $domainSize = $domainMaxSize;
|
|
|
+ }
|
|
|
+ }
|
|
|
$api = new KerioWhmcs('whmcsKerioEmail', 'Thurdata', '1.0');
|
|
|
try {
|
|
|
$api->login($params['serverhostname'], $params['serverusername'], $params['serverpassword']);
|
|
|
@@ -83,9 +96,9 @@ class CreateAccount extends AddonController
|
|
|
logModuleCall(
|
|
|
'kerioEmail',
|
|
|
__FUNCTION__,
|
|
|
- $productManager,
|
|
|
+ $accounts,
|
|
|
'Debug ID',
|
|
|
- $params
|
|
|
+ $domainSize
|
|
|
);
|
|
|
} catch (KerioApiException $error) {
|
|
|
|