|
|
@@ -65,6 +65,8 @@ class DeleteListDataProvider extends BaseDataProvider
|
|
|
return ['error' => $error->getMessage()];
|
|
|
}
|
|
|
|
|
|
+ $api->logout();
|
|
|
+
|
|
|
return (new HtmlDataJsonResponse())->setMessageAndTranslate('distributionListHasBeenDeleted')->setStatusSuccess();
|
|
|
}
|
|
|
|
|
|
@@ -75,21 +77,40 @@ class DeleteListDataProvider extends BaseDataProvider
|
|
|
*/
|
|
|
$hid = $this->request->get('id');
|
|
|
|
|
|
+ $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 $id)
|
|
|
{
|
|
|
|
|
|
- logModuleCall(
|
|
|
- 'kerioEmail',
|
|
|
- __FUNCTION__,
|
|
|
- $id,
|
|
|
- 'Debug add ML',
|
|
|
- $hid
|
|
|
- );
|
|
|
+ try {
|
|
|
+ $result = $api->deleteMailinglist($id);
|
|
|
+ } catch (KerioApiException $error) {
|
|
|
+ logModuleCall(
|
|
|
+ 'kerioEmail',
|
|
|
+ __FUNCTION__,
|
|
|
+ $error,
|
|
|
+ 'Debug Error',
|
|
|
+ $error->getMessage()
|
|
|
+ );
|
|
|
+ return ['error' => $error->getMessage()];
|
|
|
+ }
|
|
|
|
|
|
}
|
|
|
+ $api->logout();
|
|
|
|
|
|
return (new HtmlDataJsonResponse())->setMessageAndTranslate('massDistributionListHasBeenDeleted')->setStatusSuccess();
|
|
|
}
|