public function actionIndex() { if (!Yii::app()->customer->isGuest) { $this->render('index'); } else { $this->redirect('site/login'); } }