|
|
@@ -164,14 +164,41 @@ class AccountDataProvider extends BaseDataProvider
|
|
|
$productManager = new ProductManager();
|
|
|
$productManager->loadByHostingId($hid);
|
|
|
|
|
|
+ $status['isEnabled'] = $this->formData['status'] === 'active' ? TRUE : FALSE;
|
|
|
+ $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()];
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* run service for each id
|
|
|
*/
|
|
|
foreach($this->request->get('massActions') as $id)
|
|
|
{
|
|
|
-
|
|
|
+ try {
|
|
|
+ $result = $api->modifyUser($id, $status);
|
|
|
+ } catch (KerioApiException $error) {
|
|
|
+ logModuleCall(
|
|
|
+ 'kerioEmail',
|
|
|
+ __FUNCTION__,
|
|
|
+ $error,
|
|
|
+ 'Debug Error',
|
|
|
+ $error->getMessage()
|
|
|
+ );
|
|
|
+ return ['error' => $error->getMessage()];
|
|
|
+ }
|
|
|
}
|
|
|
-
|
|
|
+ $api->logout();
|
|
|
+
|
|
|
logModuleCall(
|
|
|
'kerioEmail',
|
|
|
__FUNCTION__,
|