| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- <?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',
- ],
- ]);
- }
- }
|