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(); $productManager->loadById($params['pid']); $service = (new KerioManager()) ->getApiByServer($params['serverid']) ->soap ->service() ->changePackages($productManager->get('cos_name')) ->setProductManager($productManager) ->setFormData($params) ; $result = $service->run(); // $configuration = ProductConfiguration::where('product_id', $params['pid'])->get(); // foreach($configuration as $cModel) // { // $config[$cModel->setting] = $cModel->value; // } // // $new_account_size = $config['acc_size']; // // //todo mailboxes from API // // $repository = (new KerioManager()) // ->getApiByServer($params['serverid']) // ->soap // ->repository(); // // $mailboxesApi = $repository->accounts->getByDomainName($params['domain']); // // if ($config['coss_name'] == "customMGkerio") // { // $attr = $config; // foreach ($attr as $key => &$item) // { // if (preg_match('/kerio.+/', $key)) // { // $item = $item == "on" ? "TRUE" : "FALSE"; // } // else // { // unset($attr[$key]); // } // } // // $attr['kerioMailQuota'] = $new_account_size * 1048576; // }elseif ($config['coss_name'] == 'cosQuota') // { // //todo // }else{ // // } // // foreach($mailboxesApi as $key => $value) // { // //todo // } return Response::SUCCESS; } }