|
|
@@ -9,6 +9,7 @@ use ThurData\Servers\KerioEmail\App\Libs\Kerio\Components\Api\Soap\Models\Accoun
|
|
|
use ThurData\Servers\KerioEmail\Core\Models\Whmcs\Hosting;
|
|
|
use ThurData\Servers\KerioEmail\Core\UI\ResponseTemplates\HtmlDataJsonResponse;
|
|
|
use ThurData\Servers\KerioEmail\Core\UI\Widget\Forms\DataProviders\BaseDataProvider;
|
|
|
+use ThurData\Servers\KerioEmail\Api\KerioWhmcs;
|
|
|
|
|
|
/**
|
|
|
*
|
|
|
@@ -38,16 +39,41 @@ class DeleteEmailAliasDataProvider extends BaseDataProvider
|
|
|
*/
|
|
|
$hid = $this->request->get('id');
|
|
|
|
|
|
- /**
|
|
|
- * product manager allow to check product settings
|
|
|
- */
|
|
|
+ $api = new KerioWhmcs('whmcsKerioEmail', 'Thurdata', '1.0');
|
|
|
+ try {
|
|
|
+ $api->login($this->getWhmcsParamByKey('serverhostname'), $this->getWhmcsParamByKey('serverusername'), $this->getWhmcsParamByKey('serverpassword'));
|
|
|
+ } catch (KerioApiException $error) {
|
|
|
+ logModuleCall(
|
|
|
+ 'kerioEmail',
|
|
|
+ __FUNCTION__,
|
|
|
+ $error,
|
|
|
+ 'Debug Error',
|
|
|
+ $error->getMessage()
|
|
|
+ );
|
|
|
+ return ['error' => $error->getMessage()];
|
|
|
+ }
|
|
|
+ try {
|
|
|
+ $result = $api->deleteAlias($this->formData['id']);
|
|
|
+ } catch (KerioApiException $error) {
|
|
|
+ logModuleCall(
|
|
|
+ 'kerioEmail',
|
|
|
+ __FUNCTION__,
|
|
|
+ $error,
|
|
|
+ 'Debug Error',
|
|
|
+ $error->getMessage()
|
|
|
+ );
|
|
|
+ return ['error' => $error->getMessage()];
|
|
|
+ }
|
|
|
+
|
|
|
logModuleCall(
|
|
|
'kerioEmail',
|
|
|
__FUNCTION__,
|
|
|
$this->formData['id'],
|
|
|
'Debug Error',
|
|
|
- $this->formData
|
|
|
+ $result
|
|
|
);
|
|
|
+ $api->logout();
|
|
|
+
|
|
|
$productManager = new ProductManager();
|
|
|
$productManager->loadByHostingId($hid);
|
|
|
|