checkExtensionOrThrowError(); /** * run kerio service */ $result = $this->kerioRunService($params); return $result; }catch (\Exception $ex) { /** * return some crit error */ return $ex->getMessage(); } } /** * @param null $params * @return string */ protected function kerioRunService($params = null) { $productManager = new ProductManager(); $configOption = new ConfigOptionsHelper; $updateLimit = new UpdateLimit; $productManager->loadById($params['pid']); $api = new KerioWhmcs('whmcsKerioEmail', 'Thurdata', '1.0'); try { $api->login($params['serverhostname'], $params['serverusername'], $params['serverpassword']); $domainId = $api->getDomainId('rondomali.ch'); } catch (KerioApiException $error) { logModuleCall( 'kerioEmail', __FUNCTION__, $error, 'Debug Error', $error->getMessage() ); return ['error' => $error->getMessage()]; } if ($domainId === FALSE) { return "Error: Domain $domain not found"; } logModuleCall( 'kerioEmail', __FUNCTION__, $params, 'Debug ChangPackage', $domainId ); $api->logout(); return Response::SUCCESS; } }