|
@@ -85,16 +85,45 @@ class DeleteEmailAliasDataProvider extends BaseDataProvider
|
|
|
$productManager = new ProductManager();
|
|
$productManager = new ProductManager();
|
|
|
$productManager->loadByHostingId($hid);
|
|
$productManager->loadByHostingId($hid);
|
|
|
|
|
|
|
|
- foreach ($this->request->get('massActions') as $endodedData)
|
|
|
|
|
|
|
+ $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()];
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ foreach ($this->request->get('massActions') as $aliasId)
|
|
|
{
|
|
{
|
|
|
|
|
+ try {
|
|
|
|
|
+ $result = $api->deleteAlias($aliasId);
|
|
|
|
|
+ } catch (KerioApiException $error) {
|
|
|
|
|
+ logModuleCall(
|
|
|
|
|
+ 'kerioEmail',
|
|
|
|
|
+ __FUNCTION__,
|
|
|
|
|
+ $error,
|
|
|
|
|
+ 'Debug Error',
|
|
|
|
|
+ $error->getMessage()
|
|
|
|
|
+ );
|
|
|
|
|
+ return ['error' => $error->getMessage()];
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
logModuleCall(
|
|
logModuleCall(
|
|
|
'kerioEmail',
|
|
'kerioEmail',
|
|
|
__FUNCTION__,
|
|
__FUNCTION__,
|
|
|
- $endodedData,
|
|
|
|
|
|
|
+ $aliasId,
|
|
|
'Debug Error',
|
|
'Debug Error',
|
|
|
- ''
|
|
|
|
|
|
|
+ $result
|
|
|
);
|
|
);
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
|
|
+ $api->logout();
|
|
|
|
|
|
|
|
return (new HtmlDataJsonResponse())->setMessageAndTranslate('massEmailAliasHasBeenDeleted')->setStatusSuccess();
|
|
return (new HtmlDataJsonResponse())->setMessageAndTranslate('massEmailAliasHasBeenDeleted')->setStatusSuccess();
|
|
|
|
|
|