public function actionChooseSession() { // TODO validate! make sure they can only set to what they're allowed if (isset($_POST['ClassSession'])) { ClassSession::setSessionId($_POST['ClassSession']['id']); if (isset($_GET['returnTo'])) { $this->redirect($_GET['returnTo']); } } $this->render('_session_chooser', array('sessions' => ClassSession::allSessions(Yii::app()->user->name != 'admin'), 'saved' => ClassSession::savedSessionId())); }