protected function beforeAction($action) { // check that LoginRequired is satified first $parentcheck = parent::beforeAction($action); if ($parentcheck) { // then check if user is activated if (!Yii::app()->user->data()->isActivated()) { $this->redirect(Yii::t('urls', '/')); } } return $parentcheck; }
/** * Rules for CAccessControlFilter. * * We enable the registration and other basic pages for guest users. * * @see http://www.yiiframework.com/doc/api/1.1/CController#accessRules-detail * * @return array Rules for the "accessControl" filter. */ public function accessRules() { return array_merge([['allow', 'actions' => ['index', 'error']]], parent::accessRules()); }