|
@@ -8,6 +8,9 @@ use ThurData\Servers\KerioEmail\App\Libs\Product\ProductManager;
|
|
|
use ThurData\Servers\KerioEmail\App\Traits\ExtensionsCheckerTrait;
|
|
use ThurData\Servers\KerioEmail\App\Traits\ExtensionsCheckerTrait;
|
|
|
use ThurData\Servers\KerioEmail\Core\App\Controllers\Instances\AddonController;
|
|
use ThurData\Servers\KerioEmail\Core\App\Controllers\Instances\AddonController;
|
|
|
use ThurData\Servers\KerioEmail\App\Models\ProductConfiguration;
|
|
use ThurData\Servers\KerioEmail\App\Models\ProductConfiguration;
|
|
|
|
|
+use ThurData\Servers\KerioEmail\Api\KerioWhmcs;
|
|
|
|
|
+use ThurData\Servers\KerioEmail\Core\Helper\ConfigOptionsHelper;
|
|
|
|
|
+use ThurData\Servers\KerioEmail\Core\Helper\UpdateLimit;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
*
|
|
*
|
|
@@ -59,61 +62,13 @@ class ChangePackage extends AddonController
|
|
|
$productManager = new ProductManager();
|
|
$productManager = new ProductManager();
|
|
|
$productManager->loadById($params['pid']);
|
|
$productManager->loadById($params['pid']);
|
|
|
|
|
|
|
|
- $service = (new KerioManager())
|
|
|
|
|
- ->getApiByServer($params['serverid'])
|
|
|
|
|
- ->soap
|
|
|
|
|
- ->service()
|
|
|
|
|
- ->changePackages($productManager->get('cos_name'))
|
|
|
|
|
- ->setProductManager($productManager)
|
|
|
|
|
- ->setFormData($params)
|
|
|
|
|
- ;
|
|
|
|
|
-
|
|
|
|
|
- $result = $service->run();
|
|
|
|
|
-
|
|
|
|
|
-// $configuration = ProductConfiguration::where('product_id', $params['pid'])->get();
|
|
|
|
|
-// foreach($configuration as $cModel)
|
|
|
|
|
-// {
|
|
|
|
|
-// $config[$cModel->setting] = $cModel->value;
|
|
|
|
|
-// }
|
|
|
|
|
-//
|
|
|
|
|
-// $new_account_size = $config['acc_size'];
|
|
|
|
|
-//
|
|
|
|
|
-// //todo mailboxes from API
|
|
|
|
|
-//
|
|
|
|
|
-// $repository = (new KerioManager())
|
|
|
|
|
-// ->getApiByServer($params['serverid'])
|
|
|
|
|
-// ->soap
|
|
|
|
|
-// ->repository();
|
|
|
|
|
-//
|
|
|
|
|
-// $mailboxesApi = $repository->accounts->getByDomainName($params['domain']);
|
|
|
|
|
-//
|
|
|
|
|
-// if ($config['coss_name'] == "customMGkerio")
|
|
|
|
|
-// {
|
|
|
|
|
-// $attr = $config;
|
|
|
|
|
-// foreach ($attr as $key => &$item)
|
|
|
|
|
-// {
|
|
|
|
|
-// if (preg_match('/kerio.+/', $key))
|
|
|
|
|
-// {
|
|
|
|
|
-// $item = $item == "on" ? "TRUE" : "FALSE";
|
|
|
|
|
-// }
|
|
|
|
|
-// else
|
|
|
|
|
-// {
|
|
|
|
|
-// unset($attr[$key]);
|
|
|
|
|
-// }
|
|
|
|
|
-// }
|
|
|
|
|
-//
|
|
|
|
|
-// $attr['kerioMailQuota'] = $new_account_size * 1048576;
|
|
|
|
|
-// }elseif ($config['coss_name'] == 'cosQuota')
|
|
|
|
|
-// {
|
|
|
|
|
-// //todo
|
|
|
|
|
-// }else{
|
|
|
|
|
-//
|
|
|
|
|
-// }
|
|
|
|
|
-//
|
|
|
|
|
-// foreach($mailboxesApi as $key => $value)
|
|
|
|
|
-// {
|
|
|
|
|
-// //todo
|
|
|
|
|
-// }
|
|
|
|
|
|
|
+ logModuleCall(
|
|
|
|
|
+ 'kerioEmail',
|
|
|
|
|
+ __FUNCTION__,
|
|
|
|
|
+ $productManager,
|
|
|
|
|
+ 'Debug ChangePackage',
|
|
|
|
|
+ $params
|
|
|
|
|
+ );
|
|
|
|
|
|
|
|
return Response::SUCCESS;
|
|
return Response::SUCCESS;
|
|
|
}
|
|
}
|