public function actionTransfer()
 {
     $model = new Domain();
     $model->scenario = 'transfer';
     $transferDataProvider = null;
     if (Yii::$app->request->isPost) {
         $post = Yii::$app->request->post($model->formName(), []);
         if (!empty($post[0]['domains'])) {
             $domains = [];
             foreach (StringHelper::explode($post[0]['domains'], "\n") as $line) {
                 preg_match('/^([a-z0-9][0-9a-z.-]+)(?:[,;\\s]+)(.*)/i', $line, $matches);
                 if ($matches) {
                     $domain = strtolower($matches[1]);
                     $password = $matches[2];
                     $domains[] = compact('domain', 'password');
                 }
             }
             $post = $domains;
         }
         $collection = (new Collection(['model' => $model]))->load($post);
         $models = $collection->getModels();
         foreach ($models as $model) {
             try {
                 Domain::perform('CheckTransfer', $model->getAttributes(['domain', 'password']));
             } catch (ErrorResponseException $e) {
                 $model->addError('password', $e->getMessage());
             }
         }
         Yii::$app->session->setFlash('transferGrid', 1);
         $transferDataProvider = new ArrayDataProvider(['models' => $models]);
     }
     return $this->render('index', ['model' => $model, 'transferDataProvider' => $transferDataProvider]);
 }
 /**
  * @return string
  */
 public function actionCheckDomain()
 {
     $results = [];
     $model = new Domain();
     $model->scenario = 'check-domain';
     $repository = Yii::createObject(DomainTariffRepository::class);
     $tariff = $repository->getTariff();
     $zones = $repository->getZones($tariff, DomainResource::TYPE_DOMAIN_REGISTRATION);
     $dropDownZones = [];
     foreach ($zones as $resource) {
         $dropDownZones[$resource->zone] = '.' . $resource->zone;
     }
     uasort($dropDownZones, function ($a, $b) {
         return $a === '.com' ? 0 : 1;
     });
     if ($model->load(Yii::$app->request->get(), '') && !empty($dropDownZones)) {
         // Check if domain already have zone
         if (strpos($model->domain, '.') !== false) {
             list($domain, $zone) = explode('.', $model->domain, 2);
             if (!in_array('.' . $zone, $dropDownZones, true)) {
                 $zone = 'com';
             }
             $model->zone = $zone;
         }
         if ($model->validate()) {
             $requestedDomain = $model->domain . '.' . $model->zone;
             foreach ($dropDownZones as $zone => $label) {
                 $domains[] = $model->domain . '.' . $zone;
             }
             // Make the requestedDomain the first element of array
             $domains = array_diff($domains, [$requestedDomain]);
             array_unshift($domains, $requestedDomain);
             foreach ($domains as $domain) {
                 $results[] = ['fqdn' => $domain, 'domain' => $model->domain, 'zone' => substr($domain, strpos($domain, '.') + 1)];
             }
         }
     }
     return $this->render('checkDomain', ['model' => $model, 'dropDownZonesOptions' => $dropDownZones, 'results' => $results]);
 }
                    <li>
                        <a href="#" data-filter=".audio_music"><?php 
echo Yii::t('hipanel/domainchecker', 'Audio&Music');
?>
                            <span class="label label-default pull-right"><?php 
echo Domain::getCategoriesCount('audio_music', $results);
?>
</span>
                        </a>
                    </li>
                    <li>
                        <a href="#" data-filter=".home_gifts"><?php 
echo Yii::t('hipanel/domainchecker', 'Home&Gifts');
?>
                            <span class="label label-default pull-right"><?php 
echo Domain::getCategoriesCount('home_gifts', $results);
?>
</span>
                        </a>
                    </li>
                </ul>
            </div>
            <!-- /.box-body -->
        </div>

    </div>

    <div class="col-md-9">

        <div class="row">
            <div class="col-md-12">
 public static function defaultColumns()
 {
     return ['domain' => ['class' => MainColumn::class, 'attribute' => 'domain', 'note' => true, 'filterAttribute' => 'domain_like'], 'state' => ['format' => 'raw', 'filter' => function ($grid, $model, $attribute) {
         return Html::activeDropDownList($model, $attribute, Domain::stateOptions(), ['prompt' => '--', 'class' => 'form-control']);
     }, 'filterInputOptions' => ['style' => 'width:120px'], 'value' => function ($model) {
         $out = State::widget(compact('model'));
         if ($model->is_freezed || $model->is_holded) {
             $out .= '<br>';
             $out .= $model->is_freezed ? Html::tag('span', Html::tag('span', '', ['class' => Menu::iconClass('fa-snowflake-o')]) . ' ' . Yii::t('hipanel:domain', 'Froze'), ['class' => 'label label-info']) : '';
             $out .= $model->is_holded ? ' ' . Html::tag('span', Html::tag('span', '', ['class' => Menu::iconClass('fa-ban')]) . ' ' . Yii::t('hipanel:domain', 'Held'), ['class' => 'label label-warning']) : '';
         }
         return $out;
     }], 'whois_protected' => ['class' => BootstrapSwitchColumn::class, 'attribute' => 'whois_protected', 'filter' => false, 'url' => Url::toRoute('set-whois-protect'), 'popover' => 'WHOIS protection', 'pluginOptions' => ['offColor' => 'warning']], 'is_secured' => ['class' => BootstrapSwitchColumn::class, 'filter' => false, 'url' => Url::toRoute('set-lock'), 'attribute' => 'is_secured', 'popover' => Yii::t('hipanel:domain', 'Protection from transfer')], 'note' => ['class' => XEditableColumn::class, 'attribute' => 'note', 'filter' => true, 'popover' => Yii::t('hipanel:domain', 'Make any notes for your convenience'), 'pluginOptions' => ['url' => 'set-note']], 'created_date' => ['attribute' => 'created_date', 'format' => 'date', 'filter' => false, 'contentOptions' => ['class' => 'text-nowrap']], 'expires' => ['format' => 'raw', 'filter' => false, 'headerOptions' => ['style' => 'width:1em'], 'value' => function ($model) {
         return Expires::widget(compact('model'));
     }], 'autorenewal' => ['class' => BootstrapSwitchColumn::class, 'label' => Yii::t('hipanel', 'Autorenew'), 'filter' => false, 'url' => Url::toRoute('set-autorenewal'), 'popover' => Yii::t('hipanel:domain', 'The domain will be autorenewed for one year in a week before it expires if you have enough credit on your account')], 'nameservers' => ['format' => 'raw', 'value' => function ($model) {
         return ArraySpoiler::widget(['data' => $model->nameservers]);
     }], 'actions' => ['class' => MenuColumn::class, 'menuClass' => DomainActionsMenu::class], 'old_actions' => ['class' => ActionColumn::class, 'template' => '{view} {manage-dns} {notify-transfer-in} {approve-preincoming} {reject-preincoming} {approve-transfer} {reject-transfer} {cancel-transfer} {sync} {enable-hold} {disable-hold} {enable-freeze} {disable-freeze} {delete-agp} {delete}', 'header' => Yii::t('hipanel', 'Actions'), 'buttons' => ['notify-transfer-in' => function ($url, $model, $key) {
         return $model->state === 'preincoming' ? Html::a('<i class="fa fa-envelope-o"></i>' . Yii::t('hipanel:domain', 'Send FOA again'), $url, ['data' => ['method' => 'post', 'data-pjax' => '0']]) : '';
     }, 'approve-preincoming' => function ($url, $model, $key) {
     }, 'reject-preincoming' => function ($url, $model, $key) {
     }, 'approve-transfer' => function ($url, $model, $key) {
         return $model->state === 'outgoing' && Yii::$app->user->can('support') && Domain::notDomainOwner($model) ? Html::a('<i class="fa fa-exclamation-circle"></i>' . Yii::t('hipanel:domain', 'Approve transfer'), $url, ['data' => ['confirm' => Yii::t('hipanel:domain', 'Are you sure you want to approve outgoing transfer of domain {domain}?', ['domain' => $model->domain]), 'method' => 'post', 'data-pjax' => '0']]) : '';
     }, 'reject-transfer' => function ($url, $model, $key) {
         return $model->state === 'outgoing' ? Html::a('<i class="fa fa-anchor"></i>' . Yii::t('hipanel:domain', 'Reject transfer'), $url, ['data' => ['confirm' => Yii::t('hipanel:domain', 'Are you sure you want to reject outgoing transfer of domain {domain}?', ['domain' => $model->domain]), 'method' => 'post', 'data-pjax' => '0']]) : '';
     }, 'cancel-transfer' => function ($url, $model, $key) {
         return $model->state === 'incoming' ? Html::a('<i class="fa fa-exclamation-triangle"></i>' . Yii::t('hipanel:domain', 'Cancel transfer'), $url, ['data' => ['confirm' => Yii::t('hipanel:domain', 'Are you sure you want to cancel incoming transfer of domain {domain}?', ['domain' => $model->domain]), 'method' => 'post', 'data-pjax' => '0']]) : '';
     }, 'sync' => function ($url, $model, $key) {
         return in_array($model->state, ['ok', 'expired'], true) && Yii::$app->user->can('support') && Domain::notDomainOwner($model) ? Html::a('<i class="fa ion-ios-loop-strong"></i>' . Yii::t('hipanel:domain', 'Synchronize contacts'), $url, ['data' => ['method' => 'post', 'data-pjax' => '0']]) : '';
     }, 'delete' => function ($url, $model, $key) {
         return in_array($model->state, ['ok', 'expired', 'outgoing'], true) && Yii::$app->user->can('support') ? Html::a('<i class="fa fa-trash-o"></i>' . Yii::t('hipanel', 'Delete'), $url, ['title' => Yii::t('hipanel', 'Delete'), 'aria-label' => Yii::t('hipanel', 'Delete'), 'data' => ['confirm' => Yii::t('hipanel:domain', 'Are you sure you want to delete domain {domain}?', ['domain' => $model->domain]), 'method' => 'post', 'data-pjax' => '0']]) : '';
     }, 'delete-agp' => function ($url, $model, $key) {
         if (!in_array($model->state, ['ok'], true)) {
             return '';
         }
         if (time() >= strtotime('+5 days', strtotime($model->created_date))) {
             return '';
         }
         if (strtotime('+1 year', time()) < strtotime($model->expires)) {
             return '';
         }
         return in_array(Domain::getZone($model->domain), ['com', 'net'], true) ? Html::a('<i class="fa fa-trash-o"></i>' . Yii::t('hipanel:domain', 'Delete by AGP'), $url, ['title' => Yii::t('hipanel:domain', 'Delete by AGP'), 'aria-label' => Yii::t('hipanel:domain', 'Delete by AGP'), 'data' => ['confirm' => Yii::t('hipanel:domain', 'Are you sure you want to delete domain {domain}?', ['domain' => $model->domain]), 'method' => 'post', 'data-pjax' => '0']]) : '';
     }, 'enable-freeze' => function ($url, $model, $key) {
         return !$model->is_freezed && Yii::$app->user->can('support') && Domain::notDomainOwner($model) ? Html::a('<i class="fa fa-lock"></i>' . Yii::t('hipanel:domain', 'Freeze domain'), $url, ['data' => ['method' => 'post', 'data-pjax' => '0']]) : '';
     }, 'disable-freeze' => function ($url, $model, $key) {
         return $model->is_freezed && Yii::$app->user->can('support') && Domain::notDomainOwner($model) ? Html::a('<i class="fa fa-unlock"></i>' . Yii::t('hipanel:domain', 'Unfreeze domain'), $url, ['data' => ['method' => 'post', 'data-pjax' => '0']]) : '';
     }, 'enable-hold' => function ($url, $model, $key) {
         if ($model->is_holded) {
             return '';
         }
         if (Yii::$app->user->can('support') && Yii::$app->user->not($model->client_id) && Yii::$app->user->not($model->seller_id)) {
             return Html::a('<i class="fa fa-bomb"></i>' . Yii::t('hipanel:domain', 'Enable Hold'), $url);
         }
         return '';
     }, 'disable-hold' => function ($url, $model, $key) {
         return $model->is_holded && in_array($model->state, ['ok', 'expired'], true) && Yii::$app->user->can('support') && Domain::notDomainOwner($model) ? Html::a('<i class="fa fa-link"></i>' . Yii::t('hipanel:domain', 'Disable Hold'), $url, ['data' => ['method' => 'post', 'data-pjax' => '0']]) : '';
     }, 'manage-dns' => function ($url, $model, $key) {
         if (Yii::getAlias('@dns', false)) {
             return Html::a('<i class="fa fa-globe"></i>' . Yii::t('hipanel:domain', 'Manage DNS'), ['@dns/zone/view', 'id' => $model->id]);
         }
         return '';
     }]]];
 }
<?php

/**
 * @var array
 * @var $state string
 */
use hipanel\modules\domain\models\Domain;
use yii\helpers\Html;
use yii\helpers\Url;
/** @var array $line */
$addToCartPath = '/domain/domain/add-to-cart-registration';
?>

<div class="domain-iso-line
    <?php 
echo Domain::setIsotopeFilterValue($line['zone']);
?>
    <?php 
echo $line['isAvailable'] ? 'available' : 'unavailable';
?>
    <?php 
echo $line['fqdn'] === $requestedDomain ? 'popular' : $requestedDomain;
?>
">
    <div
        class="domain-line <?php 
echo $line['isAvailable'] === true ? 'checked' : '';
?>
"
        data-domain="<?php 
echo $line['fqdn'];
<?php

use hipanel\modules\domain\forms\CheckForm;
use hipanel\modules\domain\models\Domain;
use yii\helpers\Html;
use yii\helpers\Url;
/** @var CheckForm $model */
$addToCartPath = '/domain/domain/add-to-cart-registration';
?>

<div class="domain-iso-line
    <?php 
echo Domain::setIsotopeFilterValue($model->zone);
?>
    <?php 
echo $model->isAvailable ? 'available' : 'unavailable';
?>
    <?php 
//= $line['fqdn'] === $requestedDomain ? 'popular' : $requestedDomain
?>
">
    <div
        class="domain-line <?php 
echo $model->isAvailable ? 'checked' : '';
?>
"
        data-domain="<?php 
echo $model->fqdn;
?>
">
        <div class="col-md-5 col-sm-12 col-xs-12">
<?php 
foreach ($domainContacts as $k => $v) {
    ?>
    <?php 
    if (!in_array(Domain::getZone($v['domain']), ['ru', 'su', 'рф'])) {
        ?>
        <?php 
        echo Html::hiddenInput('id[]', $k);
        ?>
    <?php 
    }
}
?>

<?php 
foreach (Domain::contactOptionsWithLabel() as $item => $label) {
    ?>
<div class="form-group">
    <?php 
    echo Html::label($label, $item, ['class' => 'col-sm-4 control-label']);
    ?>
    <div class="col-sm-8">
        <?php 
    echo Html::dropDownList($item, count($domainContacts) < 2 ? reset($domainContacts)[$item] : null, $modelContactInfo, ['prompt' => '--', 'id' => 'modal_' . $item, 'class' => 'form-control']);
    ?>
        <p class="help-block help-block-error"></p>
    </div>
</div>
<?php 
}
?>
 public function actionGetContactsByAjax($id)
 {
     if (Yii::$app->request->isAjax) {
         $domainContactInfo = Domain::perform('GetContactsInfo', ['id' => $id]);
         return $this->renderAjax('_contactsTables', ['domainContactInfo' => $domainContactInfo]);
     } else {
         Yii::$app->end();
     }
 }
 public function items()
 {
     $url = 'http://' . $this->model->domain . '/';
     return [['icon' => 'fa-paper-plane', 'label' => Yii::t('hipanel:domain', 'Go to site {link}', ['link' => StringHelper::truncate($url, 15)]), 'url' => $url, 'encode' => false, 'linkOptions' => ['target' => '_blank']], 'view' => ['label' => Yii::t('hipanel', 'View'), 'icon' => 'fa-info', 'url' => ['@domain/view', 'id' => $this->model->id], 'encode' => false], ['label' => Yii::t('hipanel:domain', 'Send FOA again'), 'icon' => 'fa-envelope-o', 'url' => ['@domain/notify-transfer-in'], 'linkOptions' => ['data' => ['method' => 'post', 'pjax' => '0', 'form' => 'notify-transfer-in', 'params' => ['Domain[id]' => $this->model->id]]], 'encode' => false, 'visible' => $this->model->state === Domain::STATE_PREINCOMING], ['label' => Yii::t('hipanel:domain', 'approve-preincoming'), 'url' => '#', 'visible' => false, 'encode' => false], ['label' => Yii::t('hipanel:domain', 'reject-preincoming'), 'url' => '#', 'visible' => false, 'encode' => false], ['label' => Yii::t('hipanel:domain', 'Approve transfer'), 'icon' => 'fa-exclamation-circle', 'url' => ['@domain/approve-transfer'], 'visible' => $this->model->state === Domain::STATE_OUTGOING && Yii::$app->user->can('support') && Domain::notDomainOwner($this->model), 'encode' => false, 'linkOptions' => ['data' => ['confirm' => Yii::t('hipanel:domain', 'Are you sure you want to cancel incoming transfer of domain {domain}?', ['domain' => $this->model->domain]), 'method' => 'post', 'pjax' => '0', 'form' => 'approve-transfer', 'params' => ['Domain[id]' => $this->model->id]]]], ['label' => Yii::t('hipanel:domain', 'Reject transfer'), 'icon' => 'fa-anchor', 'url' => ['reject-transfer', 'id' => $this->model->id], 'visible' => $this->model->state === Domain::STATE_OUTGOING, 'encode' => false], ['label' => Yii::t('hipanel:domain', 'Cancel transfer'), 'icon' => 'fa-exclamation-triangle', 'url' => ['@domain/cancel-transfer'], 'linkOptions' => ['data' => ['confirm' => Yii::t('hipanel:domain', 'Are you sure you want to cancel incoming transfer of domain {domain}?', ['domain' => $this->model->domain]), 'method' => 'post', 'pjax' => '0', 'form' => 'cancel-transfer', 'params' => ['Domain[id]' => $this->model->id]]], 'visible' => $this->model->state === Domain::STATE_INCOMING, 'encode' => false], ['label' => Yii::t('hipanel:domain', 'Synchronize contacts'), 'icon' => 'fa-refresh', 'url' => ['sync', 'id' => $this->model->id], 'visible' => $this->model->isSynchronizable() && in_array($this->model->state, [Domain::STATE_OK, Domain::STATE_EXPIRED], true) && Yii::$app->user->can('support') && Domain::notDomainOwner($this->model), 'encode' => false], ['label' => Yii::t('hipanel:domain', 'Delete by AGP'), 'icon' => 'fa-trash-o', 'url' => ['@domain/delete-agp'], 'linkOptions' => ['confirm' => Yii::t('hipanel:domain', 'Are you sure you want to delete domain {domain}?', ['domain' => $this->model->domain]), 'method' => 'post', 'data-pjax' => '0', 'form' => 'delete-agp', 'params' => ['Domain[id]' => $this->model->id]], 'visible' => Yii::$app->user->can('manage') && in_array($this->model->state, [Domain::STATE_OK], true) && time() <= strtotime('+5 days', strtotime($this->model->created_date)) && strtotime('+1 year', time()) > strtotime($this->model->expires) && in_array(Domain::getZone($this->model->domain), ['com', 'net'], true), 'encode' => false], ['label' => !$this->model->isFreezed() ? Yii::t('hipanel:domain', 'Freeze domain') : Yii::t('hipanel:domain', 'Unfreeze domain'), 'url' => !$this->model->isFreezed() ? ['@domain/enable-freeze'] : ['@domain/disable-freeze'], 'icon' => 'fa-snowflake-o', 'visible' => !$this->model->isRussianZones() && Yii::$app->user->can('support') && Domain::notDomainOwner($this->model), 'linkOptions' => ['data' => ['method' => 'post', 'pjax' => '0', 'form' => 'freeze-' . $this->model->id, 'params' => ['Domain[id]' => $this->model->id]]]], ['label' => !$this->model->isWPFreezed() ? Yii::t('hipanel:domain', 'Enable WHOIS-protect freeze') : Yii::t('hipanel:domain', 'Disable WHOIS-protect freeze'), 'url' => !$this->model->isWPFreezed() ? ['enable-w-p-freeze'] : ['disable-w-p-freeze'], 'icon' => 'fa-snowflake-o', 'visible' => !$this->model->isRussianZones() && Yii::$app->user->can('support') && Domain::notDomainOwner($this->model), 'linkOptions' => ['data' => ['method' => 'post', 'pjax' => '0', 'form' => 'freeze-w-p-' . $this->model->id, 'params' => ['Domain[id]' => $this->model->id]]]], ['label' => !$this->model->isHolded() ? Yii::t('hipanel:domain', 'Enable Hold') : Yii::t('hipanel:domain', 'Disable Hold'), 'url' => !$this->model->isHolded() ? ['@domain/enable-hold'] : ['@domain/disable-hold'], 'icon' => !$this->model->isHolded() ? 'fa-ban' : 'fa-link', 'linkOptions' => ['data' => ['method' => 'post', 'pjax' => '0', 'form' => 'hold-' . $this->model->id, 'params' => ['Domain[id]' => $this->model->id]]], 'visible' => !in_array(Domain::getZone($this->model->domain), ['ru', 'su', 'рф'], true) && (Yii::$app->user->can('support') && Yii::$app->user->not($this->model->client_id) && Yii::$app->user->not($this->model->seller_id))], ['label' => Yii::t('hipanel:domain', 'Manage DNS'), 'icon' => 'fa-globe', 'url' => ['@dns/zone/view', 'id' => $this->model->id], 'visible' => Yii::getAlias('@dns', false), 'encode' => false]];
 }
 public function actionChangeContact($contactId = null, $contactType = null, $domainId = null, $domainName = null)
 {
     if (!Yii::$app->request->isPost) {
         $model = $this->findModel($contactId);
         $model->scenario = 'change-contact';
         return $this->render('changeContact', ['countries' => $this->getRefs('country_code', 'hipanel'), 'askPincode' => Client::perform('HasPincode'), 'model' => $model, 'domainId' => $domainId, 'domainName' => $domainName, 'contactType' => $contactType]);
     } else {
         $model = new Contact(['scenario' => 'create']);
         if ($model->load(Yii::$app->request->post())) {
             $domainContactInfo = Domain::perform('GetContactsInfo', ['id' => $model->domainId]);
             $setContactOptions = ['domain' => $model->domainName, 'id' => $model->domainId];
             if ($model->save()) {
                 foreach (Domain::$contactOptions as $contact) {
                     $setContactOptions[$contact] = $contact === $model->contactType ? $model->id : $domainContactInfo[$contact]['id'];
                 }
                 Domain::perform('SetContacts', $setContactOptions);
                 $this->redirect(['@domain/view', 'id' => $model->domainId]);
             }
         }
     }
 }
Esempio n. 11
0
        <?php 
    echo $search->field('client_id')->widget(ClientCombo::class);
    ?>
    </div>

    <div class="col-md-4 col-sm-6 col-xs-12">
        <?php 
    echo $search->field('seller_id')->widget(SellerCombo::class);
    ?>
    </div>
<?php 
}
?>

<div class="col-md-4 col-sm-6 col-xs-12">
    <?php 
echo $search->field('state')->dropDownList(Domain::stateOptions(), ['prompt' => '--']);
?>
</div>

<div class="col-md-4 col-sm-6 col-xs-12">
    <div class="form-group">
        <?php 
echo Html::tag('label', Yii::t('hipanel:domain', 'Registered range'), ['class' => 'control-label']);
?>
        <?php 
echo DatePicker::widget(['model' => $search->model, 'attribute' => 'created_from', 'attribute2' => 'created_till', 'type' => DatePicker::TYPE_RANGE, 'pluginOptions' => ['autoclose' => true, 'format' => 'dd-mm-yyyy']]);
?>
    </div>
</div>
<?php

use hipanel\modules\domain\models\Domain;
use yii\helpers\Html;
$options = ['method' => 'post', 'data-pjax' => '0'];
if (!$model->is_holded && (Yii::$app->user->can('support') && Yii::$app->user->not($model->client_id) && Yii::$app->user->not($model->seller_id))) {
    ?>
    <li>
        <?php 
    echo Html::a('<i class="fa fa-fw fa-bomb"></i> ' . Yii::t('hipanel:domain', 'Enable Hold'), ['@domain/enable-hold', 'id' => $model->id], $options);
    ?>
    </li>
<?php 
} elseif ($model->is_holded && in_array($model->state, ['ok', 'expired'], true) && Yii::$app->user->can('support') && Domain::notDomainOwner($model)) {
    ?>
    <li>
        <?php 
    echo Html::a('<i class="fa fa-fw fa-link"></i> ' . Yii::t('hipanel:domain', 'Disable Hold'), ['@domain/disable-hold', 'id' => $this->model->id], $options);
    ?>
    </li>
<?php 
}
Esempio n. 13
0
 /**
  * Sends API request to check whether domain is available and sets result to [[isAvailable]]
  *
  * @return bool whether domain is available
  */
 public function checkIsAvailable()
 {
     try {
         $check = Domain::perform('Check', ['domains' => [$this->fqdn]], true);
         $this->isAvailable = $check[$this->fqdn] === 1;
     } catch (ErrorResponseException $e) {
         $this->isAvailable = false;
     }
     return $this->isAvailable;
 }
 public function actionIndex()
 {
     $options = ['model' => ClientController::findModel(['id' => Yii::$app->user->identity->id, 'with_tickets_count' => true, 'with_domains_count' => Yii::getAlias('@domain', false) ? true : false, 'with_servers_count' => true, 'with_hosting_count' => true, 'with_contacts_count' => true]), 'totalCount' => []];
     if (Yii::$app->user->can('manage')) {
         if (Yii::getAlias('@domain', false)) {
             $options['totalCount']['domains'] = Domain::find()->count();
         }
         if (Yii::getAlias('@server', false)) {
             $options['totalCount']['servers'] = Server::find()->count();
         }
         if (Yii::getAlias('@ticket', false)) {
             $options['totalCount']['tickets'] = Thread::find()->count();
         }
     }
     return $this->render('index', $options);
 }