|
@@ -61,15 +61,30 @@ class ChangePackage extends AddonController
|
|
|
|
|
|
|
|
$productManager = new ProductManager();
|
|
$productManager = new ProductManager();
|
|
|
$productManager->loadById($params['pid']);
|
|
$productManager->loadById($params['pid']);
|
|
|
|
|
+ $api = new KerioWhmcs('whmcsKerioEmail', 'Thurdata', '1.0');
|
|
|
|
|
+ try {
|
|
|
|
|
+ $api->login($params['serverhostname'], $params['serverusername'], $params['serverpassword']);
|
|
|
|
|
+ $result = $api->getDomains(['name', 'id']);
|
|
|
|
|
+ } catch (KerioApiException $error) {
|
|
|
|
|
+ logModuleCall(
|
|
|
|
|
+ 'kerioEmail',
|
|
|
|
|
+ __FUNCTION__,
|
|
|
|
|
+ $error,
|
|
|
|
|
+ 'Debug Error',
|
|
|
|
|
+ $error->getMessage()
|
|
|
|
|
+ );
|
|
|
|
|
+ return ['error' => $error->getMessage()];
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
logModuleCall(
|
|
logModuleCall(
|
|
|
'kerioEmail',
|
|
'kerioEmail',
|
|
|
__FUNCTION__,
|
|
__FUNCTION__,
|
|
|
- $productManager,
|
|
|
|
|
|
|
+ $result,
|
|
|
'Debug ChangePackage',
|
|
'Debug ChangePackage',
|
|
|
$params
|
|
$params
|
|
|
);
|
|
);
|
|
|
|
|
|
|
|
|
|
+ $api->logout();
|
|
|
return Response::SUCCESS;
|
|
return Response::SUCCESS;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|