<commit_before><?php
/**
 * Domain plugin for HiPanel
 *
 * @link      https://github.com/hiqdev/hipanel-module-domain
 * @package   hipanel-module-domain
 * @license   BSD-3-Clause
 * @copyright Copyright (c) 2015-2017, HiQDev (http://hiqdev.com/)
 */

namespace hipanel\modules\domain\controllers;

use hipanel\actions\SmartPerformAction;
use hipanel\actions\ValidateFormAction;
use hipanel\helpers\StringHelper;
use hipanel\modules\domain\cart\DomainTransferProduct;
use hipanel\modules\domain\models\Domain;
use hipanel\filters\EasyAccessControl;
use hiqdev\hiart\Collection;
use hiqdev\hiart\ResponseErrorException;
use hiqdev\yii2\cart\actions\AddToCartAction;
use Yii;
use yii\data\ArrayDataProvider;

class TransferController extends \hipanel\base\CrudController
{
    /**
     * {@inheritdoc}
     */
    public static function newModel($config = [], $submodel = '')
    {
        $config['class'] = Domain::class;

        return Yii::createObject($config);
    }

    public function behaviors()
    {
        return array_merge(parent::behaviors(), [
            [
                'class' => EasyAccessControl::class,
                'actions' => [
                    'add-to-cart-transfer' => '?',
                    'validate-form' => '?',
                    'index' => '?',
                    '*' => 'domain.read',
                ],
            ],
        ]);
    }

    /**
     * {@inheritdoc}
     */
    public function actions()
    {
        return [
            'add-to-cart-transfer' => [
                'class' => AddToCartAction::class,
                'productClass' => DomainTransferProduct::class,
                'bulkLoad' => true,
            ],
            'validate-form' => [
                'class' => ValidateFormAction::class,<commit_msg>Allowed transfer for authenticated users as well<commit_after><?php
/**
 * Domain plugin for HiPanel
 *
 * @link      https://github.com/hiqdev/hipanel-module-domain
 * @package   hipanel-module-domain
 * @license   BSD-3-Clause
 * @copyright Copyright (c) 2015-2017, HiQDev (http://hiqdev.com/)
 */

namespace hipanel\modules\domain\controllers;

use hipanel\actions\SmartPerformAction;
use hipanel\actions\ValidateFormAction;
use hipanel\helpers\StringHelper;
use hipanel\modules\domain\cart\DomainTransferProduct;
use hipanel\modules\domain\models\Domain;
use hipanel\filters\EasyAccessControl;
use hiqdev\hiart\Collection;
use hiqdev\hiart\ResponseErrorException;
use hiqdev\yii2\cart\actions\AddToCartAction;
use Yii;
use yii\data\ArrayDataProvider;

class TransferController extends \hipanel\base\CrudController
{
    /**
     * {@inheritdoc}
     */
    public static function newModel($config = [], $submodel = '')
    {
        $config['class'] = Domain::class;

        return Yii::createObject($config);
    }

    public function behaviors()
    {
        return array_merge(parent::behaviors(), [
            [
                'class' => EasyAccessControl::class,
                'actions' => [
                    'add-to-cart-transfer' => true,
                    'validate-form' => true,
                    'index' => true,
                    '*' => 'domain.read',
                ],
            ],
        ]);
    }

    /**
     * {@inheritdoc}
     */
    public function actions()
    {
        return [
            'add-to-cart-transfer' => [
                'class' => AddToCartAction::class,
                'productClass' => DomainTransferProduct::class,
                'bulkLoad' => true,
            ],
            'validate-form' => [
                'class' => ValidateFormAction::class,
{'fraction_non_alphanumeric': 0.13527777777777777, 'fraction_numerical': 0.005555555555555556, 'mean_word_length': 2.1449781659388645, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 27, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '352901', 'n_tokens_mistral': 1078, 'n_tokens_neox': 1055, 'n_words': 172}