<?php

namespace app\controllers;

use Yii;
use app\models\OrganizerForm;
use app\models\Profile;
use app\models\User;



class ProfileController extends \dektrium\user\controllers\ProfileController
{
	 
	    public function behaviors()
    {
        $behaviors = parent::behaviors();
        $behaviors['access'] = [
            'class' => AccessControl::className(),
            'rules' => [
                [
                    'allow' => true,
                    'actions' => ['index', 'show'],
                    'roles' => ['@'],
                ],
            ],
        ];
        return $behaviors;
    }

    public function init()
    {
        parent::init();
        if(Yii::$app->user->isGuest)
        {
            return $this->redirect('/user/login');
        }
    }

    public function actions()
    {
        // return [
        //     'error' => [
        //         'class' => 'yii\web\ErrorAction',
        //     ],
        //     'captcha' => [
        //         'class' => 'yii\captcha\CaptchaAction',
        //         //'fixedVerifyCode' => YII_ENV_TEST ? 'testme' : null,
        //         // 'transparent'=>true,
        //         // 'minLength'=>3,
        //         // 'maxLength'=>4,
        //     ],
        // ];
        return array_merge(parent::actions(), [
            'error' => [
                'class' => 'yii\web\ErrorAction',
            ],
            'captcha' => [
                'class' => 'yii\captcha\CaptchaAction',
            ],
        ]);        
    }


}