|
|
@@ -145,16 +145,20 @@ class RessourceDataProvider extends BaseDataProvider
|
|
|
|
|
|
public function update()
|
|
|
{
|
|
|
- /**
|
|
|
- * hosting id
|
|
|
- */
|
|
|
- $hid = $this->request->get('id');
|
|
|
-
|
|
|
- /**
|
|
|
- * product manager allow to check product settings
|
|
|
- */
|
|
|
- $productManager = new ProductManager();
|
|
|
- $productManager->loadByHostingId($hid);
|
|
|
+ $api = new KerioWhmcs('whmcsKerioEmail', 'Thurdata', '1.0');
|
|
|
+ try {
|
|
|
+ $api->login($this->getWhmcsParamByKey('serverhostname'), $this->getWhmcsParamByKey('serverusername'), $this->getWhmcsParamByKey('serverpassword'));
|
|
|
+ $domainID = $api->getDomainId($this->getWhmcsParamByKey('domain'));
|
|
|
+ } catch (KerioApiException $error) {
|
|
|
+ logModuleCall(
|
|
|
+ 'kerioEmail',
|
|
|
+ __FUNCTION__,
|
|
|
+ $error,
|
|
|
+ 'Debug Error',
|
|
|
+ $error->getMessage()
|
|
|
+ );
|
|
|
+ return ['error' => $error->getMessage()];
|
|
|
+ }
|
|
|
|
|
|
logModuleCall(
|
|
|
'kerioEmail',
|
|
|
@@ -163,12 +167,17 @@ class RessourceDataProvider extends BaseDataProvider
|
|
|
'Debug Error',
|
|
|
$this->formData
|
|
|
);
|
|
|
- /**
|
|
|
- * run service for each id
|
|
|
- */
|
|
|
- foreach($this->request->get('massActions') as $id)
|
|
|
- {
|
|
|
-
|
|
|
+ try {
|
|
|
+ $result = $api->updateResouce(['isEnabled' => false], $this->request->get('massActions'));
|
|
|
+ } catch (KerioApiException $error) {
|
|
|
+ logModuleCall(
|
|
|
+ 'kerioEmail',
|
|
|
+ __FUNCTION__,
|
|
|
+ $error,
|
|
|
+ 'Debug Error',
|
|
|
+ $error->getMessage()
|
|
|
+ );
|
|
|
+ return ['error' => $error->getMessage()];
|
|
|
}
|
|
|
|
|
|
/**
|