| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- <?php
- namespace ThurData\Servers\KerioEmail\App\UI\Client\DomainAlias\Providers;
- use ThurData\Servers\KerioEmail\App\Helpers\KerioManager;
- use ThurData\Servers\KerioEmail\App\Libs\Product\ProductManager;
- use ThurData\Servers\KerioEmail\App\Libs\Kerio\Components\Api\Soap\Repository;
- use ThurData\Servers\KerioEmail\App\Libs\Kerio\Components\Api\Soap\Services\Create\CreateDistributionList;
- use ThurData\Servers\KerioEmail\App\Libs\Kerio\Components\Api\Soap\Services\Create\CreateDomainAlias;
- use ThurData\Servers\KerioEmail\App\Libs\Kerio\Components\Api\Soap\Services\Delete\DeleteDomainAlias;
- use ThurData\Servers\KerioEmail\Core\Models\Whmcs\Hosting;
- use ThurData\Servers\KerioEmail\Core\UI\ResponseTemplates\HtmlDataJsonResponse;
- use ThurData\Servers\KerioEmail\Core\UI\Widget\Forms\DataProviders\BaseDataProvider;
- use ThurData\Servers\KerioEmail\Api\KerioWhmcs;
- /**
- *
- * Created by PhpStorm.
- * User: ThurData
- * Date: 18.09.19
- * Time: 13:39
- * Class AddDomainAliasDataProvider
- */
- class AddDomainAliasDataProvider extends BaseDataProvider
- {
- public function read()
- {
- $hosting = Hosting::where('id', $this->getRequestValue('id'))->first();
- $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()];
- }
- $this->data['domainId'] = $domainID;
- $this->data['domain'] = $this->getWhmcsParamByKey('domain');
- }
- public function update()
- {
- }
- public function create()
- {
- /**
- * hosting id
- */
- $hid = $this->request->get('id');
- logModuleCall(
- 'kerioEmail',
- __FUNCTION__,
- $this,
- 'Debug Error',
- $this->formData
- );
- return (new HtmlDataJsonResponse())->setMessageAndTranslate('domainAliasHasBeenCreated')->setStatusSuccess();
- }
- }
|